Colors in Terminal/iTerm2

Submitted by Jochus on Tue, 19/06/2012 - 21:58 | Posted in: Mac


I once created a wiki page about PS1 variables and colors in a terminal. This post was created for Ubuntu environments.
However, this variable doesn't seem to work in Mac OS X/iTerm2. I had to change it to:

\[\033[1;32m\]\u@\h\[\033[0m\] \[\033[1;36m\]\w\[\033[0m\] $

Add new comment

The content of this field is kept private and will not be shown publicly.

Full HTML

  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.