Colourful console in FreeBSD
I moved a few months ago. Moving from time to time is probably a Good Thing™. While going through my stuff, I came across a printout of this posting to the freebsd-stable mailling list back in 2007.
On a virtual machine running FreeBSD 8.2-STABLE and booting off a couple of ZFS mirrored root disks, I created the file /usr/src/sys/i386/conf/COLOURFUL and placed these lines in that file:
include GENERIC ident COLOURFUL options SC_HISTORY_SIZE=2000 options SC_NORM_ATTR=(FG_LIGHTGREEN|BG_BLACK) options SC_NORM_REV_ATTR=(FG_YELLOW|BG_BLACK) options SC_KERNEL_CONS_ATTR=(FG_LIGHTBLUE|BG_BLACK) options SC_KERNEL_CONS_REV_ATTR=(FG_LIGHTRED|BG_BLACK)
Next, /etc/make.conf was changed to allow for the use of the COLOURFUL kernel instead of the GENERIC kernel:
KERNCONF=COLOURFUL
Here’s some snapshots showing the result after recompiling and installing world and the COLOURFUL kernel:
If you use a command like vidcontrol VGA_80x25 in your ~/.bash_logout file, you’ll reset the colours on the particular vty to their default values, i.e. white on black.
# ~/.bash_logout at enterprise.ximalas.info.
tty | grep -q ttyv && ( vidcontrol VGA_80x25 && i=0; while [ "${i}" != "${TTYVHISTORYLINES}" ]; do echo; i=$[${i}+1]; done )
clear
# EOF of ~/.bash_logout.
![COLOURFULL-001 [The first boot lines from a FreeBSD 8.2-STABLE kernel]](http://ximalas.info/wp-content/uploads/2011/08/COLOURFULL-001.png)
![COLOURFULL-005 [Just to show what ZFS versions this VM was using at the time]](http://ximalas.info/wp-content/uploads/2011/08/COLOURFULL-005.png)
![COLOURFULL-002 [Showing the difference between kernel console output and regular console output by userland]](http://ximalas.info/wp-content/uploads/2011/08/COLOURFULL-002.png)
![COLOURFULL-003 [Booting completed]](http://ximalas.info/wp-content/uploads/2011/08/COLOURFULL-003.png)
![COLOURFULL-004 [The first few lines of the man page for the ls command]](http://ximalas.info/wp-content/uploads/2011/08/COLOURFULL-004.png)