Bash shell integration -- exit code is not restored when PROMPT_COMMAND is an array#158091
Merged
Tyriar merged 5 commits intoOct 6, 2022
Conversation
When the original PROMPT_COMMAND is an array: # exit code of last executed command was not restored before executing the commands stored inside the original PROMPT_COMMAND array # __vsc_status was assigned the exit code of the penultimate command stored inside the original PROMPT_COMMAND array Note: the proposed fix also works when PROMPT_COMMAND is not an array
CyrilOtheninGirard
force-pushed
the
exit-code-is-not-restored-when-PROMPT_COMMAND-is-an-array
branch
from
August 13, 2022 19:54
8ec0f7d to
880ffb6
Compare
…MPT_COMMAND-is-an-array
meganrogge
self-requested a review
October 6, 2022 14:23
meganrogge
requested changes
Oct 6, 2022
meganrogge
self-requested a review
October 6, 2022 15:36
meganrogge
approved these changes
Oct 6, 2022
Tyriar
approved these changes
Oct 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This solves issue #158090 "Bash shell integration -- exit code is not restored when PROMPT_COMMAND is an array".
Note: this fix also works when PROMPT_COMMAND is not an array, because in BASH you can apply the array syntax on single (i.e. non-array) variable.
Example :
"$xxx" == "${xxx[0]}"whatever the type of xxx: a single variable or an array.