Created by: JrCs
Hi, i use a PROMPT_COMMAND with a function to get the latest exit code like this
prompt() {
# Check exit code
local exit_code=$?
if [[ $exit_code -eq 0 ]];then
# do something
else
# do other things
fi
}
PROMPT_COMMAND="prompt"
The problem with the modification of PROMPT_COMMAND by autojump.bash is that it add himself at the start of the PROMPT_COMMAND variable and so the exit code in my function is always 0. It will better if autojump will add himself at the end of the PROMPT_COMMAND variable to avoid this issue.
In attachment the patch to fix this issue