Monday, April 18, 2005

How to Get Colors in OpenBSD Terminals

Due to compliance with POSIX standards, by default you won’t get any colors in terminals in an out-of-the-box OpenBSD installation as the default terminal is vt220. Here is what you need to do:

A. Colors in Terminals without X
1. Install the "colorls" package
2. In ~/.profile, set your TERM so that it supports color and create an alias for "ls" command so that it will show list of color directories in color.

export TERM=wsvt25
alias ls='colorls -G'

B. Colors in Terminals with X (xterms)
The only issue here is when you open xterms it won’t read your ~/.profile file (the xterm is not a login shell) as OpenBSD has followed the xfree86 way. So, in ~/.Xdefaults add the following line:

XTerm*loginShell: true

If you don’t have the .Xdefaults file in your home directory, simple copy it from /etc/X11/app-defaults/ directory.

Comment: Yeah, you have to do a bit of tweaking, but the wonderful fact is the way OpenBSD sticks to compliances and standards. There is always a clear policy why things happen and not just because of arbitrary decisions or random user needs.

0 Comments:

Post a Comment

<< Home