I installed FreeBSD 9 in a virtual machine to try it out. I installed bash, and attempted to use tput to provide colors for my scripts. However, I have a slight problem with it.
I asked around a bit and was told to check infocmp. I googled, found it was part of ncurses, so I did pkg_add -r ncurses.
Now I have infocmp, which lists a whole lot of information about my default terminal, rxvt. tput still provides nothing but empty strings however.
How do I make tput output something useful? I'd rather not use hardcoded colors, as the scripts I'm trying to port from Linux use tput for their colors already and I want to change them as little as possible.
I am connecting to the machine through SSH, by the way.
Code:
[[ -n "$(TERM=rxvt tput sgr0)" ]] || echo fail
fail
[[ -n "$(TERM=xterm tput sgr0)" ]] || echo fail
fail
[[ -n "$(TERM=xterm-color tput sgr0)" ]] || echo fail
fail
Now I have infocmp, which lists a whole lot of information about my default terminal, rxvt. tput still provides nothing but empty strings however.
How do I make tput output something useful? I'd rather not use hardcoded colors, as the scripts I'm trying to port from Linux use tput for their colors already and I want to change them as little as possible.
I am connecting to the machine through SSH, by the way.