summaryrefslogtreecommitdiff
path: root/zshrc
diff options
context:
space:
mode:
Diffstat (limited to 'zshrc')
-rw-r--r--zshrc35
1 files changed, 17 insertions, 18 deletions
diff --git a/zshrc b/zshrc
index edf7b19..bfe0c60 100644
--- a/zshrc
+++ b/zshrc
@@ -1,7 +1,7 @@
#! /bin/false
if [ -e /etc/zsh/zshenv ]; then
- . /etc/zsh/zshenv
+ . /etc/zsh/zshenv
fi
HOSTNAME="`hostname`"
@@ -253,13 +253,13 @@ fi
case $TERM in
xterm*|rxvt*)
function update-title() {
- print -Pn "\033]0;$1\007"
+ print -n "\033]0;$1\007"
}
function build-and-update-title() {
local location cmd title
- location="$1"
- cmd="$2"
- if [ "$cmd" = "" ]; then
+ location="$(print -P $1)"
+ cmd="${2:-}"
+ if [ -z "$cmd" ]; then
title="$location"
else
title="$cmd [$location]"
@@ -272,19 +272,18 @@ case $TERM in
screen*)
if [ -n "${TMUX:-}" ] && [ -x /usr/bin/tmux ] ; then
function update-title() {
- print -Pn "\033]0;$1\007"
+ print -n "\033]0;$1\007"
}
function build-and-update-title() {
local location cmd title
- location="$1"
- cmd="$2"
- if [ "$cmd" = "" ]; then
- tmux rename-window `print -Pn "%~"`
- title="%n@%m"
+ location="$(print -P $1)"
+ cmd="${2:-}"
+ if [ -z "$cmd" ]; then
+ title="$location"
+ tmux rename-window "$title"
else
tmux setw automatic-rename on > /dev/null
- title="$cmd [$location]"
- title=`echo $title | tr '\n' ' '`
+ title="$location:$cmd"
fi
update-title "$title"
}
@@ -294,12 +293,12 @@ case $TERM in
}
function build-and-update-title() {
local location cmd title
- location="$1"
- cmd="$2"
- if [ "$cmd" = "" ]; then
- title=`print -Pn "%~"`
+ location="$(print -P "%~")"
+ cmd="${2:-}"
+ if [ -z "$cmd" ]; then
+ title="$location"
else
- title=`print -Pn "%~:$cmd"`
+ title="$location:$cmd"
fi
update-title "$title"
}