Console Syntax Highlighting

Jez Hancock jez.hancock at munk.nu
Sun May 11 15:25:16 PDT 2003


On Sun, May 11, 2003 at 02:51:23PM -0700, Nicolas Galler wrote:
> btw one of the problem I had when switching between freebsd, linux and sun is
> the terminfo file for cons25 from one of the other os landed in my .terminfo
> directory and it had some kind of default colorless info.
> So you might want to check on terminfo(5), see if you get colors if you do
> something like
> echo -e '\e[31mhello'
> see if echo $TERM gives cons25. Try ls -FG with root.
> see if you get colors in an xterm (you might need TERM=xterm-color as previous
> poster pointed out... seems to work as is for me though with ls -FG), also
> if you are telnetting from a linux box it's a bit special.
This is a good point I forgot to mention - I have a minimally effective
clause in my .cshrc file to help in the case I login on a system console
(cons25):

switch ($TERM)
	case xterm*:
		setenv TERM xterm-color
		# make the title bar say 'user at hostname':
		echo -n "${e}]2;${USER}@${host}${g}"
endsw

This is good as long as you use a tty emulator that sets the $TERM env
variable, although I'm sure there are plenty of cases where it won't
work.  Worth a shot anyway :)

Jez


More information about the freebsd-questions mailing list