Since KDE 3.5.4 the konsole has 256 color support. You don’t believe it? Test 256 color support in your terminal:

echo -e "\e[38;5;196mred\e[38;5;46mgreen\e[38;5;21mblue\e[0m"

If the words are displayed in the right colours, all is well.

Not you have 256 and you want to use it, sure. First we want vim with 256 colors! Goto the konsole configuration and set the TERM variable in the “Session” tab to xterm-256color. If you’re using screen, then you have to add

term        "screen-256color"

to your “screenrc”-file.

Maybe you recognize that your “ls” doesn’t colorize the output anymore. The reason is that there is no entry for xterm-246color and screen-256color in /etc/DIR_COLORS.

The last problem I had to fix was the color bug with vim and screen. If vim has set a background color and you exit vim, your console still use the colors set by vim. It is a weird problem and currently I’ve fixed it with an autocmd:

autocmd VimLeave * :set term=screen

You can find a screenshot of my konsole with 256color vim here.

5 thoughts on “konsole-256color

  1. Wow, cool news, thanks for sharing! 🙂 I read this on planet suse.

  2. To get emacs (emacs23 or higher) to use 256 colors, you also TERM=screen-256color won’t work, so you’ll need TERM=xterm-256color instead. I had to adjust my screenrc Accordingly. On older systems running emacs21 this method doesn’t work though. Anyway, thanks for your post.

  3. in debian there is ncurses-term package which adds a bunch of terminal definitions, among those are konsole, screen.konsole and konsole-256color. So now i reconfigged everything to use that.

Leave a Reply

Your email address will not be published. Required fields are marked *