enable 256 color support
Bug #409353 reported by
Scott Moser
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
byobu |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
byobu (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland |
Bug Description
bug 87966 has instructions on how to setup 256 color support in screen.
in short, enable it by these screenrc commands:
----
# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:
# erase background with current bg color
defbce "on"
----
then, to test it:
wget http://
Changed in byobu: | |
status: | New → Fix Released |
Changed in byobu: | |
status: | Incomplete → Confirmed |
status: | Confirmed → Triaged |
Changed in byobu: | |
status: | Triaged → Fix Committed |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in byobu (Ubuntu): | |
status: | New → Fix Committed |
importance: | Undecided → Wishlist |
assignee: | nobody → Dustin Kirkland (kirkland) |
Changed in byobu: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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 WINDOW= "$SHELL -c motd+shell" .$PKG/windows" && DEFAULT_WINDOW=
+++ /usr/bin/byobu 2010-01-09 17:48:47.742590537 -0500
@@ -44,9 +44,12 @@
DEFAULT_
grep -qs "^[^#]" "$HOME/
+# Check if our terminfo supports 256 colors $PKG/profiles/ byoburc" $DEFAULT_WINDOW $PKG/profiles/ byoburc" $DEFAULT_WINDOW .$PKG/profile" "$@" .$PKG/profile" "$@"
+[ -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/
+ exec screen $SCREEN_TERM -c "/usr/share/
else
- exec screen -c "$HOME/
+ exec screen $SCREEN_TERM -c "$HOME/
fi
When connecting from putty or SecureCRT send xterm-256color to get a host terminfo that supports 256 colors.