jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.15k stars 340 forks source link

getting long bash prompt with whole dir hierarchy #28

Closed link2pk closed 8 years ago

link2pk commented 8 years ago

Hi Jimeh,

your plugin is great & it is working but I'm getting the whole directory structure in bash prompt like: mac-user-name: /Applications/XAMPP/htdocs/projectname (branch-name) $

Can I just have the branch-name like: mac-user-name:projectname (branch-name) $

I'm on OSX El Capitan. Thanks & thank you for this plugin

jimeh commented 8 years ago

Hey, you can get back to full default OSX prompt style by setting PS1 like so:

export PS1="\u@\h \W \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "

The difference from the OSX variant in the readme is the use of \W instead of \w. I'll update the readme to use \W as that is now the default behavior of OSX as of quite a few years back.

link2pk commented 8 years ago

Great, working fine.

Thanks a lot.