mirror of
https://github.com/gunchev/home_bin.git
synced 2025-11-20 12:15:46 +00:00
Don't add our prompt_command twice, also prepend
During testing if you source it twice you get that problem now. The error code formatting/logging gets broken if we run prompt_command after other stuff. Running anything external obviously resets $?.
This commit is contained in:
parent
4fe20ce6c9
commit
54ccd1efb9
1 changed files with 4 additions and 1 deletions
|
|
@ -154,7 +154,10 @@ ${C2})${C3}\$${NO_COLOUR} "
|
||||||
if [ -z "${PROMPT_COMMAND}" ]; then
|
if [ -z "${PROMPT_COMMAND}" ]; then
|
||||||
export PROMPT_COMMAND=prompt_command
|
export PROMPT_COMMAND=prompt_command
|
||||||
else
|
else
|
||||||
export PROMPT_COMMAND="${PROMPT_COMMAND}; prompt_command"
|
if ! echo "${PROMPT_COMMAND}" | grep '\bprompt_command\b' > /dev/null 2>&1; then
|
||||||
|
export PROMPT_COMMAND="prompt_command
|
||||||
|
${PROMPT_COMMAND}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
trap prompt_command_exit EXIT
|
trap prompt_command_exit EXIT
|
||||||
shopt -s cmdhist histappend
|
shopt -s cmdhist histappend
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue