Skip to content

Commit

Permalink
If PROMPT_COMMAND is not empty, prepend to it instead of replacing it
Browse files Browse the repository at this point in the history
  • Loading branch information
AnttiBoman committed Jul 18, 2018
1 parent a632316 commit 33300fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 2016/persistent-history/add-persistent-history.sh
Expand Up @@ -33,4 +33,9 @@ run_on_prompt_command()
log_bash_persistent_history
}

PROMPT_COMMAND="run_on_prompt_command"
if [ "$PROMPT_COMMAND" = "" ]
then
PROMPT_COMMAND="run_on_prompt_command"
else
PROMPT_COMMAND="run_on_prompt_command; ""$PROMPT_COMMAND"
fi

0 comments on commit 33300fc

Please sign in to comment.