Improved Terminal hotness

A few months ago (!) I wrote about customizing your Terminal prompt. It would seem I had a bug in there that caused some awful wrapping in Terminal, but fret not, there is a solution. Matt Wright was kind enough to hit me up with a fix, so here are the…

A few months ago (!) I wrote about customizing your Terminal prompt. It would seem I had a bug in there that caused some awful wrapping in Terminal, but fret not, there is a solution. Matt Wright was kind enough to hit me up with a fix, so here are the new goods with instructions on how to update.

As you recall, here’s what we’re going for with our new Terminal prompt:

New Terminal prompt

To get us there, open ~/.bash_profile. If you already have a modified prompt, replace the existing similar line with this new snippet. If you don’t have one yet, just add the following snippet:

export PS1='\[\e[0:35m⌘\e[m \e[0:36m\w/\e[m \e[0:33m`git branch 2> /dev/null | grep -e ^* | sed -E  s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\e[m\]'

Save and restart Terminal. Enjoy!


Print Share Comment Cite Upload Translate
APA
Mark Otto | Sciencx (2024-03-28T13:40:47+00:00) » Improved Terminal hotness. Retrieved from https://www.scien.cx/2013/01/13/improved-terminal-hotness/.
MLA
" » Improved Terminal hotness." Mark Otto | Sciencx - Sunday January 13, 2013, https://www.scien.cx/2013/01/13/improved-terminal-hotness/
HARVARD
Mark Otto | Sciencx Sunday January 13, 2013 » Improved Terminal hotness., viewed 2024-03-28T13:40:47+00:00,<https://www.scien.cx/2013/01/13/improved-terminal-hotness/>
VANCOUVER
Mark Otto | Sciencx - » Improved Terminal hotness. [Internet]. [Accessed 2024-03-28T13:40:47+00:00]. Available from: https://www.scien.cx/2013/01/13/improved-terminal-hotness/
CHICAGO
" » Improved Terminal hotness." Mark Otto | Sciencx - Accessed 2024-03-28T13:40:47+00:00. https://www.scien.cx/2013/01/13/improved-terminal-hotness/
IEEE
" » Improved Terminal hotness." Mark Otto | Sciencx [Online]. Available: https://www.scien.cx/2013/01/13/improved-terminal-hotness/. [Accessed: 2024-03-28T13:40:47+00:00]
rf:citation
» Improved Terminal hotness | Mark Otto | Sciencx | https://www.scien.cx/2013/01/13/improved-terminal-hotness/ | 2024-03-28T13:40:47+00:00
https://github.com/addpipe/simple-recorderjs-demo