How change letters and background colors

How to change .cshrc so that user has yellow letters on a black background. Otherwise, he has a white background behind the cursor.
 
Sorry, but foreground and background color are not primarily a function of your shell (or .cshrc), but of your terminal emulator. I have no idea what terminal emulator you are using, but all the ones I know of allow adjusting the colors. Look for "settings" or "tools" menus.

If you are running on the FreeBSD console: There are kernel tunable values for the default colors. Search the forum for them.

You are aware that programs can change the foreground/background color within an 8-color setting, by using ANSI escape sequences? So changing your color using just the prompt is likely to not have the desired effect, once you start a program such as emacs or vi that will change colors internally. Please learn about ANSI escape sequences (they tend to be of the form "ESC [ 31 m"), and understand how VTxxx emulators set colors.
 
A year later anyway.

It's the kernel settings to set colors of the virtual console terminal. It was answered above about the kernel. I believe it was in rc.conf, boot.conf or it needed to be compiled with it.

To change the color of directories.

.cshrc
Code:
set color
setenv LSCOLORS "ax"
alias ls    ls -G
a is for yellow, and x is to match the background color.
ls -G colorizes output. In the file, ls is aliased to ls -G

ls(1)
 
Back
Top