No color in Tmux

I just installed sysutils/tmux on 8.0-STABLE and seem to be having a terminfo problem. With the default config, I get no color and attempting to open any CLI app like htop returns
Code:
Error opening terminal: screen-256color.
while vim gives me a warning message saying
Code:
E558: Terminal entry not found in terminfo. 
'screen-256color' not known. Available builtin terminals are:
builtin_gui
builtin_riscos
builtin_amiga etc etc ... Defaulting to 'ansi'.

I can see a screen256-color file under /usr/local/share/misc/terminfo.db/s and I've tried building devel/ncurses --without-hash-db along with 256-color support of course but that didn't work either. After that I'm lost as to what to do though since I don't know much about termcap/terminfo and I'm still trying to read through the man page for terminfo.

Any help would be greatly appreciated,
Cloud
 
can you tell the following data.
- echo $TERM
- are you running on a tmux in a xterm session or direct on the console?

As far as I know the console supports only 16 colors.
Is the error message also present in a ssh session?
 
Sorry for the delay,
I'm running tmux from an xterm session and echo $TERM gives 'xterm'. An SSH session works fine if that's what you're asking otherwise no tmux doesn't work through ssh either. Logining in through the console always gives me this message
Code:
'/etc/termcap.db', line 0, col 23, terminal 'cons25', older tic versions may treat the description as an alias.
although it's just a warning and isn't effecting anything else.
 
Hm, I'm not an X user, guess that's why I don't have anything in /usr/local/share/misc.
Even my /etc/termcap points to /usr/share/misc/termcap.

Maybe the following from the tmux faq helps.
* How do I use a 256 colour terminal?

Provided the underlying terminal supports 256 colours, it is usually sufficient
to add the following to ~/.tmux.conf:

set -g default-terminal "screen-256color"

Note that some platforms do not support "screen-256color" ("infocmp
screen-256color" will return an error) - in this case see the next entry in
this FAQ.

tmux attempts to detect a 256 colour terminal both by looking at the colors
terminfo entry and by looking for the string "256col" in the TERM environment
variable.

If both these methods fail, the -2 flag may be passed to tmux when attaching
to a session to indicate the terminal supports 256 colours.

* vim or $otherprogram doesn't display 256 colours. What's up?

Some programs attempt to detect the number of colours a terminal is capable of
by checking the colors terminfo or Co termcap entry. However, this is not
reliable, and in any case is missing from the "screen" terminal description
used inside tmux.

There are two options (aside from using "screen-256color") to allow programs to
recognise they are running on a 256-colour terminal inside tmux:

- Manually force the application to use 256 colours always or if TERM is set to
screen. For vim, you can do this by overriding the t_Co option, see
http://vim.wikia.com/wiki/256_colors_in_vim.
- Creating a custom terminfo file that includes colors#256 in ~/.terminfo and
using it instead. These may be compiled with tic(1).
 
Back
Top