bash-git-prompt icon indicating copy to clipboard operation
bash-git-prompt copied to clipboard

Breaks VSCode GitHub Copilot Agent when running commands in the terminal

Open alebar42 opened this issue 9 months ago • 1 comments

When using VSCode GitHub Copilot Agent and allowing it to run commands in the terminal (Ubuntu in WSL2), it keeps the agent hanging and does not continue after a command it executed.

Seems when I deactivate bash-git-prompt it solves the issue.

See https://github.com/microsoft/vscode/issues/254447

alebar42 avatar May 19 '25 20:05 alebar42

I can find no way to distinguish the normal vscode terminal from the copilot terminal. Therefore a workaround is to check if the terminal has been opened by vscode in your .bashrc:

if [ -z "$VSCODE_INJECTION" ]; then
  if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
    GIT_PROMPT_ONLY_IN_REPO=1
    source $HOME/.bash-git-prompt/gitprompt.sh
  fi
fi

But that will affect all terminals opened from vscode.

eqinox76 avatar Jul 25 '25 06:07 eqinox76