So you want to add color to your terminal.
For some reason, this seems to be a problem on BSD. There are plenty of easy ways to find options for linux, but not so much for BSD.
Here's what I've found out!
First, you need to know how to create color. (Good luck finding good and easy documentation!)
In your console type the following:
echo "^[[0;31mhello"
You should have seen a "hello" appear in red! If not, then you probably aren't using a BSD!
or
You need to create the correct character. To create the ^[ character you need to type the following
ctrl + v, + ctrl + [
You will now have the correct character.
So, how do you add color to your prompt?
Open up your .cshrc
vi ~/.cshrc
Now look for the area that has the following:
if ($?prompt) then
Under that, add the following:
set prompt = "n%{33[0;33m%}%n%{33[0;36m%}@%{33[0;31m%}%m%{33[0;0m%} %{33[0;33m[%{33[0;37m %. %{33[0;33m]%}%{33[0;0m%} %{33[0;33m>%{33[0;37m%} "
You have to log in again before it takes effect.
Yeah, I know what that looks like! But it's good stuff. With that code you'll see something like this for your prompt:
user@host [ ~ ] >
So you don't like how it looks do you? Well, you can change how it looks, but not yet!
What about file and directory colors you say?
ls -G
You say that's all you need? Well, until now that's all you had!
Towards the end of your .cshrc file add the following:
#enable color display for listing files.
set color# Specify the colors for listing various file types.
#di Directory
#fi File
#ln Symbolic Link
#pi Fifo file
#so Socket file
#bd Block (buffered) special file
#cd Character (unbuffered) special file
#or Symbolic Link pointing to a non-existent file (orphan)
#mi Non-existent file pointed to by a symbolic link (visible when you type ls -l)
#ex File which is executable (ie. has 'x' set in permissions).setenv LS_COLORS "no=00:fi=0;36:di=01;33:ln=00;33;40:pi=40;33:so=01;35"
setenv LS_COLORS "$LS_COLORS":"bd=40;33;01:cd=40;33;01:or=40;31;01"
setenv LS_COLORS "$LS_COLORS":"ex=4;31:*.tar=01;31:*.tgz=01;31"#setenv LS_COLORS "$LS_COLORS":"*.arj=01;31:*.taz=01;31:*.lzh=01;31"
#setenv LS_COLORS "$LS_COLORS":"*.zip=01;31:*.z=01;31:*.Z=01;31"
#setenv LS_COLORS "$LS_COLORS":"*.gz=01;31:*.deb=01;31:*.jpg=01;35"
#setenv LS_COLORS "$LS_COLORS":"*.gif=01;35:*.bmp=01;35:*.ppm=01;35"
#setenv LS_COLORS "$LS_COLORS":"*.tga=01;35:*.xbm=01;35:*.xpm=01;35"
#setenv LS_COLORS "$LS_COLORS":"*.tif=01;35:*.mpg=01;37:*.avi=01;37"
#setenv LS_COLORS "$LS_COLORS":"*.gl=01;37:*.dl=01;37:*.tex=01;35"
#setenv LS_COLORS "$LS_COLORS":"*.ps=01;35:"
Save, quit, and login again. Now check out your files!
Excellent!
But now comes the cool part! Download this file:
http://www.ghettobsd.org/gbsd-scripts/ghettobsd-color-guide.gbsdx
And then run it!
mv ghettobsd-color-guide.gbsdx /usr/gbsd
cd /usr/gbsd
sh ghettobsd-color-guide.gbsdx
Ohhhh yeah!
So now you can go on and make something awesome with your new found abilities. Or just edit the code you've found here.