Merge pull request #984 from clayreimann/patch-2

Guard against unset COLUMNS
This commit is contained in:
Nils Winkler
2017-06-24 16:32:47 +02:00
committed by GitHub

View File

@@ -52,7 +52,7 @@ function prompt_command() {
fi
local wrap_char=""
[[ ${#new_PS1} -gt $(($COLUMNS/1)) ]] && wrap_char="\n"
[[ $COLUMNS && ${#new_PS1} > $(($COLUMNS/1)) ]] && wrap_char="\n"
PS1="${new_PS1}${green}${wrap_char}${reset_color} "
}