Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hmm, I don't have this issue. Perhaps because I use a two-line prompt?

    export PS1="\n\W\$(parse_git_branch) $ "

    parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'; }


You use a custom git parse branch, while git has a much more powerful prompt function : __git_ps1 . It's readily available in git's default bash_completion.d file. It shows the current branch, but also the state of the git tree (during rebase, am, bisecting, cherry-picking, etc.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: