0

my iterm path looks like the below, I saw the stack overflow post referencing http://support.apple.com/kb/ht1528 which didn't work. How to go about getting the file path reduced in size so that I can have a much smaller footprint?

ie, only have the current working directory and the git branch would be very useful. thanks.

[jd@mbp ~/rubyonrailstutor/curriculum_apps/restaurantly (master)]$

John
  • 1,246
  • 15
  • 34

2 Answers2

0

export PS1='[\u@mbp \W$(__git_ps1)]\$ '

John
  • 1,246
  • 15
  • 34
0

For those that are stumbling on this post years later like me. :-) Here is my setup to show only the current directory and current git branch in my terminal.

parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="{ \[\033[36m\]\u \[\033[1;31m\]@\h \[\033[00m\]} \[\033[1;37m\]\W\[\033[33m\]\$(parse_git_branch) \[\033[34m\]$ \[\033[00m\]"

This gives you the following: Terminal Output: Directory & Current Branch

Any chunk that you see like this [\033[36m\] in the export line is doing the coloring of the text. You can do a search to see what values are available.

And that's it, short, sweet and colorified. :-)

Metal Gabe
  • 51
  • 1
  • 7