Hi there.
After struggling quite some time with the terminal settings to produce
a nice looking 256 color with rxvt and screen even over ssh i thought
that my findings might be useful for other users too.
First step is to ensure that all of your programs are properly
compiled. There are now options for the according ports so double
check with [CMD="make"]config[/CMD]!
Having rxvt-unicode and screen compiled with 256 color support you
should not have a problem using this e.g. with vim in X11.
Trouble started for me after trying to use vim over ssh from a linux
box with rxvt-unicode from there.
The environment variable TERM is set to
rxvt-256color which cannot be
found in /etc/termcap. That's pitfall #1.
To solve this create a file in your $HOME called
.termcap. To do this you could run this (be careful,
this will overwrite any existing file if present):
Now vim or whatever program (e.g. ls -G) should reward you with
colored output. After starting up screen you will see that the colors
have vanished again. This is pitfall #2.
It is likely that screen complained already while executing it so
let's fix that first. It will tell you that it cannot find a termcap
entry for rxvt-256color also you just added it to
.termcap.
To make screen recognize your new private termcap entry, you need to
put the content of .termcap into the
TERMCAP environment variable. To do so add something
like this to your shell's rc file (e.g. .bashrc):
Now log out and log in again but you will see that screen still isn't
happy. That's pitfall #3 (and finally the last one). In your
.screenrc look out for a termcapinfo entry
similar to this:
Modify or create one if needed so that it looks like this:
Restart screen and now you should finally be able to enjoy all of the
256 colors.
I hope this was helpful, any comments or remarks will be appreciated.
After struggling quite some time with the terminal settings to produce
a nice looking 256 color with rxvt and screen even over ssh i thought
that my findings might be useful for other users too.
First step is to ensure that all of your programs are properly
compiled. There are now options for the according ports so double
check with [CMD="make"]config[/CMD]!
Having rxvt-unicode and screen compiled with 256 color support you
should not have a problem using this e.g. with vim in X11.
Trouble started for me after trying to use vim over ssh from a linux
box with rxvt-unicode from there.
The environment variable TERM is set to
rxvt-256color which cannot be
found in /etc/termcap. That's pitfall #1.
To solve this create a file in your $HOME called
.termcap. To do this you could run this (be careful,
this will overwrite any existing file if present):
Code:
cat > $HOME/.termcap << EOF
rxvt-256color|rxvt-256color terminal (X Window System):\
:tc=rxvt-unicode:\
:tc=rxvt:
EOF
Now vim or whatever program (e.g. ls -G) should reward you with
colored output. After starting up screen you will see that the colors
have vanished again. This is pitfall #2.
It is likely that screen complained already while executing it so
let's fix that first. It will tell you that it cannot find a termcap
entry for rxvt-256color also you just added it to
.termcap.
To make screen recognize your new private termcap entry, you need to
put the content of .termcap into the
TERMCAP environment variable. To do so add something
like this to your shell's rc file (e.g. .bashrc):
Code:
if [ -f ${HOME}/.termcap ]; then
TERMCAP=$(< ${HOME}/.termcap)
export TERMCAP
fi
Now log out and log in again but you will see that screen still isn't
happy. That's pitfall #3 (and finally the last one). In your
.screenrc look out for a termcapinfo entry
similar to this:
Code:
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
Code:
termcapinfo xterm-color|xterm-16color|xterm-88color|xterm-256color|rxvt* 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
256 colors.
I hope this was helpful, any comments or remarks will be appreciated.