I am able to show the git branch name in the shell prompt. But whenever I am using screen I am getting
bash: parse_git_branch: command not found
and git branch is not shown. Please help me get this in the screen sessions also.
I have following in my .bash_profile.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/
}
export PS1="[\W\$(parse_git_branch)]$ "
I don't have .git-completion.bash
System specs:
You are missing a '
at the end of your sed statement:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="[\W\$(parse_git_branch)]$ "
Othewerise, it seems to work for me in bash-3.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With