Skip to content

Commit efd17c6

Browse files
authored
Fix Bash integration clobbering $? for PROMPT_COMMAND
1 parent d1388fd commit efd17c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ __vsc_restore_exit_code() {
328328

329329
__vsc_prompt_cmd_original() {
330330
__vsc_status="$?"
331+
builtin local cmd
331332
__vsc_restore_exit_code "${__vsc_status}"
332333
# Evaluate the original PROMPT_COMMAND similarly to how bash would normally
333334
# See https://unix.stackexchange.com/a/672843 for technique
334-
builtin local cmd
335335
for cmd in "${__vsc_original_prompt_command[@]}"; do
336336
eval "${cmd:-}"
337337
done

0 commit comments

Comments
 (0)