From efd17c6edfb21d63068fc10637587ef28185dcc4 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 28 Aug 2024 14:45:17 +0900 Subject: [PATCH] Fix Bash integration clobbering $? for PROMPT_COMMAND --- .../contrib/terminal/browser/media/shellIntegration-bash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh index 92c0e07f5ad..fbeaa22f90a 100755 --- a/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh +++ b/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh @@ -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