Fixed omp prompt

Fixed: .envrc shows up when `direnv` does not exists
Fixed: history hook was running before _omp_hook, losing the latest
       error code.
This commit is contained in:
Gal@Shefet 2022-09-27 06:32:00 -04:00
parent d6687d8fa4
commit 09a810495f
6 changed files with 25 additions and 11 deletions

View file

@ -4,4 +4,5 @@ export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
[[ -z "$(printenv PROMPT_COMMAND | grep 'history -')" ]] && \
export PROMPT_COMMAND="$PROMPT_COMMAND; history -a; history -c; history -r"