Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bash): add case for vscode integrated terminal #5817

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/init/starship.bash
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ else
# add multiple instances of the starship function and keep other user functions if any.
if [[ -z "${PROMPT_COMMAND-}" ]]; then
PROMPT_COMMAND="starship_precmd"
# If we are running in vscode with shell integration
elif [[ "$PROMPT_COMMAND" == "__vsc_prompt_cmd_original" ]]; then
# if starship_precmd is not in vscode prompt command list, add it
if [[ ! ${__vsc_original_prompt_command[@]} =~ $(printf "\<starship_precmd\>") ]]; then
__vsc_original_prompt_command+=("starship_precmd")
fi
elif [[ "$PROMPT_COMMAND" != *"starship_precmd"* ]]; then
# Appending to PROMPT_COMMAND breaks exit status ($?) checking.
# Prepending to PROMPT_COMMAND breaks "command duration" module.
Expand Down