Comment 1 for bug 409353

Revision history for this message
Jason Cohen (kryojenik) wrote :

Support is only 95% there... byobu (screen) supports 256 colors but reports to ncurses apps via term info that it only supports 8 colors.

The TERM variable while in screen is TERM=screen or TERM=screen-bce. If you defbce in screenrc, screen is smart enough to set the TERM to screen-bce. However, the screen and screen-bce terminfo files state they are 8 Color terminals. So when you run ncurses apps they will look at the terminfo capabilites and see you are only an 8 color terminal.

You can set term screen-256color-bce in your screenrc to set this correctly (at least in karmic). That terminfo exists and is a 256 color terminal (as is screen-256color).

Or you can set in the command line to screen.

screen -T screen-256color. Again, if you have defbce set in screenrc screen will add the -bce to the term for you.

Ultimately it would be nice for screen itself to check if the term supports 256 colors and then set an appropriate TERM based on that.

As a fix to byobu in the meantime...

patch attached ... and:

--- /usr/bin/byobu.orig 2010-01-09 22:38:29.253840432 -0500
+++ /usr/bin/byobu 2010-01-09 17:48:47.742590537 -0500
@@ -44,9 +44,12 @@
 DEFAULT_WINDOW="$SHELL -c motd+shell"
 grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW=

+# Check if our terminfo supports 256 colors
+[ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors) -eq 256 ] && SCREEN_TERM="-T screen-256color"
+
 # Now let's execute screen!
 if [ "$#" = "0" ]; then
- exec screen -c "/usr/share/$PKG/profiles/byoburc" $DEFAULT_WINDOW
+ exec screen $SCREEN_TERM -c "/usr/share/$PKG/profiles/byoburc" $DEFAULT_WINDOW
 else
- exec screen -c "$HOME/.$PKG/profile" "$@"
+ exec screen $SCREEN_TERM -c "$HOME/.$PKG/profile" "$@"
 fi

When connecting from putty or SecureCRT send xterm-256color to get a host terminfo that supports 256 colors.