0

In Fedora 29, added nice branch display to my bash prompt and new tabs no longer open in current folder:

if [ -f /etc/bash_completion.d/git-prompt ]
then
  GIT_PS1_SHOWCOLORHINTS='yes'
  GIT_PS1_SHOWDIRTYSTAT='yes'
  GIT_PS1_SHOWSTASHSTATE='yes'
  GIT_PS1_SHOWUNTRACKEDFILES='yes'
  GIT_PS1_SHOWUPSTREAM='auto
  PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
fi

Result:

  • Opening new tab no longer opens in current folder

Notes:

  • Must use PROMPT_COMMAND instead of PS1 because must have colors and nice things....
  • Looks like /etc/profile.d/vte.sh is being cancelled

Resourses:

kornieff
  • 2,389
  • 19
  • 29

1 Answers1

0
function set_git_prompt() {
  __git_ps1 "\u@\h:\w" "\\\$ "
  [ $VTE_VERSION ] && __vte_prompt_command
}

if [ -f /etc/bash_completion.d/git-prompt ]
then
  GIT_PS1_SHOWCOLORHINTS='yes'
  GIT_PS1_SHOWDIRTYSTAT='yes'
  GIT_PS1_SHOWSTASHSTATE='yes'
  GIT_PS1_SHOWUNTRACKEDFILES='yes'
  GIT_PS1_SHOWUPSTREAM='auto

  PROMPT_COMMAND='set_git_prompt'
fi
kornieff
  • 2,389
  • 19
  • 29