Skip to content

Commit 0181ece

Browse files
committed
Preserve last command status in __bp_precmd_invoke_cmd. Issue 11016
1 parent 4999d18 commit 0181ece

File tree

1 file changed

+2
-0
lines changed
  • shell_integration

1 file changed

+2
-0
lines changed

shell_integration/bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ __bp_precmd_invoke_cmd() {
226226
# prompt command" by another precmd execution loop. This avoids infinite
227227
# recursion.
228228
if (( __bp_inside_precmd > 0 )); then
229+
(exit $__bp_last_ret_value)
229230
return
230231
fi
231232
local __bp_inside_precmd=1
@@ -242,6 +243,7 @@ __bp_precmd_invoke_cmd() {
242243
"$precmd_function"
243244
fi
244245
done
246+
(exit $__bp_last_ret_value)
245247
}
246248

247249
# Sets a return value in $?. We may want to get access to the $? variable in our

0 commit comments

Comments
 (0)