Merge pull request #1222 from ezchi/develop

Avoid double semicolon in the PROMPT_COMMAND
This commit is contained in:
Nils Winkler
2018-08-03 08:39:54 +02:00
committed by GitHub

View File

@@ -5,7 +5,7 @@ about-plugin 'osx-specific functions'
if [ $(uname) = "Darwin" ]; then
if type update_terminal_cwd > /dev/null 2>&1 ; then
if ! [[ $PROMPT_COMMAND =~ (^|;)update_terminal_cwd($|;) ]] ; then
PROMPT_COMMAND="$PROMPT_COMMAND;update_terminal_cwd"
PROMPT_COMMAND="${PROMPT_COMMAND%;};update_terminal_cwd"
declared="$(declare -p PROMPT_COMMAND)"
[[ "$declared" =~ \ -[aAilrtu]*x[aAilrtu]*\ ]] 2>/dev/null
[[ $? -eq 0 ]] && export PROMPT_COMMAND