0

When I am on the Mac, the terminal is bringing up colors on the path, is there a way to remove them? This is what I have:

terminal path color

3
  • Google for "PS1 prompt bash"; hint look in /etc/bashrc
    – user22908
    Apr 27 '13 at 19:00
  • 1
    This is a property of your shell (ie bash, tcsh, or zsh), not osx
    – Eric
    Apr 27 '13 at 19:00
  • Please show us the contents of your PS1 (i.e. echo $PS1) and what shell you're using.
    – slhck
    Apr 28 '13 at 20:55
1

Go into your Terminal's Preferences pane and navigate to;

Settings > Advanced

Click Display Terminal as: (or something similar, haven't got language on English there) and choose a non-color display-method;

Terminal list

1
  • 1
    Wouldn't that remove all colour from the terminal output? I am not 100% sure that the OP wants to remove all colour or just the colour from the prompt.
    – Hennes
    Apr 27 '13 at 22:35
1

I solved this by adding this to the bash_profile file:

Open the bash_profile:

vi .bash_profile

Append this at the end of the file:

export PS1="\e[0;34m[\u@\h \w]\$ \e[m "

Save and close the file.

Final result: The path is in blue 0;34, \u gives you the username \h gives you reduced host name and \w gives you full working directory.

Complete options available:

\u = your username
\H = full hostname, e.g. bob.example.com
\h = reduced hostname, e.g. bob
\w = full working directory, e.g. /home/jamie/bin
\W = basename of the working directory, e.g. bin
\t = time in 24-hour format
\# = command number
\$ = root identifier; $ for regular users, # for root
\T = time in 12-hour format
\l = terminal device, e.g. tty4
\j = number of background/suspended processes 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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