Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I use different color setting (foreground and font) for each of the window that I create?

share|improve this question

If you have a set of windows that you create when you start screen, you can put something like this into your .screenrc:

screen bash --init-file $HOME/.green
screen bash --init-file $HOME/.blue
screen bash --init-file $HOME/.red

The .red init file then contains:

# load standard bashrc file
. ~/.bashrc 

# set prompt and text color to red
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "

A more general solution would use the WINDOW environment variable, which is set by screen when it creates a new window.

case $WINDOW in 
   # red
   export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
   # blue
   export PS1="\e[0;34m[\u@\h \W]\$ \e[m "
   # no specific color
   export PS1="[\u@\h \W]\$ "
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.