From aab235f6121a93b81a425d522a0c7f2aaac946bd Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Fri, 8 Oct 2010 22:44:42 -0700 Subject: functions: fix title() to not match any $TERM On my linux virtual terminals, where TERM="linux", I was getting annoying output that was messing up my prompt. It turns out the title function was always matching on the elif statement for xterm/rxvt no matter what and the linux vt doesn't know what to do with the title special control sequence and thus was printing out garbage. Through experimentation I figured out that the || inside of the [[ ]] did not work: export TERM=linux $ if [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then echo $TERM; fi linux $ if [[ $TERM =~ "^xterm" ]] || [[ $TERM == "rxvt" ]]; then echo $TERM; fi Signed-off-by: Brandon Philips openSUSE running zsh 4.3.10 --- lib/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/functions.zsh') diff --git a/lib/functions.zsh b/lib/functions.zsh index 561586cba..e494f1f4d 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -5,7 +5,7 @@ function title { print -nR $'\033k'$1$'\033'\\\ print -nR $'\033]0;'$2$'\a' - elif [[ $TERM =~ "^xterm" || $TERM == "rxvt" ]]; then + elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]]; then # Use this one instead for XTerms: print -nR $'\033]0;'$*$'\a' fi -- cgit v1.2.3-70-g09d2 From dc12853b0c3e5af9e42f44cb9efdf57d44d20711 Mon Sep 17 00:00:00 2001 From: Sven Lito Date: Sat, 9 Oct 2010 19:11:07 +0100 Subject: merging in changes from robby's repo --- lib/functions.zsh | 1 - lib/git.zsh | 1 - 2 files changed, 2 deletions(-) (limited to 'lib/functions.zsh') diff --git a/lib/functions.zsh b/lib/functions.zsh index e494f1f4d..e3c0de43e 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -37,4 +37,3 @@ function take() { mkdir -p $1 cd $1 } - diff --git a/lib/git.zsh b/lib/git.zsh index 57a78e27f..75fdc1f9c 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -38,4 +38,3 @@ git_prompt_status() { fi echo $STATUS } - -- cgit v1.2.3-70-g09d2