You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm running Git Bash and from the shell type in "bash" to launch a subshell I see bash: __git_ps1: command not found and I lose the branch information that was in the original bash prompt.
The text was updated successfully, but these errors were encountered:
This is a known issue: when launching bash without--login, the profile is not executed, and since the functions required for the prompt to work are not inherited by subshells, you see this error message.
Quick fix: always start bash --login.
Longer fix: figure out which file is sourced by bash when starting a subshell (maybe /etc/bash.bashrc?) and put special code there to re-initialize the prompt when an interactive console is detected.
@kjeremy it would be nice to see a contributions from your side.
The proper fix for this would actually be to move the prompt from the profile to the bashrc. We can do this in git-extra but we must take pains to move the git-prompt.sh outside /etc/profile.d/ lest it be sourced as part of /etc/profile (and hence double-sourced). Then we need to edit /etc/bash.bashrc as part of git-extra.install to add the line (if it is not there yet):
test! -t 0 ||. /etc/git-prompt.sh
And then all this needs to be tested thoroughly. Ball's in your court now 😃
If I'm running Git Bash and from the shell type in "bash" to launch a subshell I see
bash: __git_ps1: command not found
and I lose the branch information that was in the original bash prompt.The text was updated successfully, but these errors were encountered: