aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2013-03-26 10:26:40 -0400
committerRyan Kavanagh <rak@debian.org>2013-03-26 10:26:40 -0400
commit5656ec1fc2b3c8c4a9727f40f9c20b5409745513 (patch)
tree3e3d72c571304702f8e037b1d63ad2f5623b84d4
parentAdd ssh keys for MIT (diff)
Fix precmd, prexec in zsh to work with tmux (again)
Diffstat (limited to '')
-rw-r--r--.zshrc15
1 files changed, 3 insertions, 12 deletions
diff --git a/.zshrc b/.zshrc
index 332d402..7ac7b6a 100644
--- a/.zshrc
+++ b/.zshrc
@@ -349,16 +349,11 @@ bindkey '\e[6~' down-history # PageDown
# This function sets the window tile to user@host:/workingdir before each
# prompt. If you're using screen, it sets the window title (works
# wonderfully for 'hardstatus' lines.
-# Beware: The two functions below have raw control characters.
precmd() {
# [[ -t 1 ]] || return
case $TERM in
- *xterm*|rxvt*) print -Pn "]2;%n@%m:%~\a"
+ *xterm*|rxvt*|screen*) print -Pn "\e]2;%n@%m:%~\a"
;;
- # Don't execute if we're in TMUX
- screen*)
- [[ -n ${TMUX} ]] || print -Pn "\"%n@%m:%~\134"
- ;;
esac
}
@@ -366,12 +361,8 @@ precmd() {
preexec() {
# [[ -t 1 ]] || return
case $TERM in
- *xterm*|rxvt*)
- print -Pn "]2;$1\a"
- ;;
- screen*)
- [[ -n ${TMUX} ]] || print -Pn "\"$1\134"
- ;;
+ *xterm*|rxvt*|screen*) print -Pn "\e]2;$1\a"
+ ;;
esac
}