Merge pull request #226929 from akinomyoga/patch-1

Fix Bash integration clobbering `$?` for PROMPT_COMMAND
pull/227084/head
Daniel Imms 2024-08-29 06:38:59 -07:00 committed by GitHub
commit 4711122b92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -328,10 +328,10 @@ __vsc_restore_exit_code() {
__vsc_prompt_cmd_original() {
__vsc_status="$?"
builtin local cmd
__vsc_restore_exit_code "${__vsc_status}"
# Evaluate the original PROMPT_COMMAND similarly to how bash would normally
# See https://unix.stackexchange.com/a/672843 for technique
builtin local cmd
for cmd in "${__vsc_original_prompt_command[@]}"; do
eval "${cmd:-}"
done