Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I'd like to color the prompt and command of my shell differently from the text printed in the output stream.

My current export for PS1 is as follows:

export PS1="\e[0;36m\h:\e[m \e[1;33m\w\e[m\[\033[32m\]\$(parse_git_branch)\[\033[00m\]\n\e[0;37m➜\e[m "

I'm coloring the first line of the multi-line prompt correctly, but in the second line I'd like to color both the prompt arrow and the command itself white, while preserving the output as gray.

For example, see the following screenshot of my shell. I'm attempting to color the command ls white in addition to the prompt arrow , but nothing else. I haven't been able to figure out how to color the command without changing the text color setting for the entire Terminal theme.

Screenshot of shell output

share|improve this question
You might get some hints from – mpy Jun 29 '13 at 10:22
See also:… - this person also wants to change their input line color, not just the PS1 (but not their output). – Caleb Xu Apr 11 '14 at 3:06

Different colors for text entry and console output explains how to do it:

export PS1="\e[0;36m\h:\e[m \e[1;33m\w\e[m\[\033[32m\]\$(parse_git_branch)\[\033[00m\]\n\e[0;37m➜ "
trap 'echo -ne "\e[0m" ' DEBUG

Should do what you want:

enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .