How can xterm 256 be enabled in ubuntu 8.04? I was able to get that working in 9.10, but not 8.04.
3 Answers
It looks like Hardy (Ubuntu 8.04) doesn't provide the terminfo entry (/usr/share/terminfo/x/xterm-256color) in the default ncurses packages. Karmic provides this entry in the ncurses-base package (Karmic, Hardy), but Hardy provides it in the ncurses-term package (Hardy).
I found this article on enabling 256-Color Xterms in Ubuntu. To enable:
Install ncurses-term:
sudo aptitude install ncurses-termCustomize the xterm entries; add this to ~/.Xdefaults:
*customization: -color XTerm*termName: xterm-256colorAdd this to ~/.xsession to apply to new terminals:
if [ -f $HOME/.Xdefaults ]; then xrdb -merge $HOME/.Xdefaults fiLog out and back in to pick up all changes, or just run
xrdb -merge ~/.XdefaultsOpen a new xterm and test with
tputandecho $TERM; you should see the following output:$ tput colors 256 $ echo $TERM xterm-256colorIf you do, you're good to go.
Additionally, some applications will need special configuration to take advantage of the new capabilities.
- 43,504
I found that simply placing this in either your .bash_profile or .profile (if the former doesn't exist) works for me:
export TERM="xterm-256color"
Then either open a new terminal session or source the profile file source ~/.bash_profile. I'm assuming you use bash, but this will probably work for most shell type dot files.
- 1,036
This should be a comment on sa125's answer but I don't have enough rep.
Archlinux's wiki entry on xterm says the following about the TERM environmental variable:
Allow xterm to report the TERM variable correctly. Do not set the TERM variable from your ~/.bashrc or ~/.bash_profile or similar file. The terminal itself should report the correct TERM to the system so that the proper terminfo file will be used. Two usable terminfo names are xterm and xterm-256color. To set the name, use the resource
XTerm.termName: xterm-256color
So you probably want to set this variable from the .Xresources file instead of .bashrc or .profile
- 11