commit 85d3ae1d351cd4e404c71aab8da3a6db16399fff parent 61391e6807b3e6427e6bf88bcc612903ec978f9f Author: Antoine Amarilli <a3nm@a3nm.net> Date: Wed, 2 Jan 2013 19:32:41 +0100 fix display of current and last command in window title Diffstat:
zsh/zshrc | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/zsh/zshrc b/zsh/zshrc @@ -88,10 +88,11 @@ preexec () { local WD="$(pwd | sed "s/^\/home\/$USER/~/")" export LASTDATE="`date +%T`" if [[ "$TERM" == "rxvt-unicode" ]]; then - #echo -ne "\e]0;$LOCALNAME $HOST:$WD$ $1 ($LASTDATE)\a" - echo -ne "\e]0;$LOCALNAME $HOST:$WD$ TODO ($LASTDATE)\a" + export COMMAND="$(echo \"$1\" | tr -d '\n')" + echo -ne "\e]0;$LOCALNAME $HOST:$WD$ $COMMAND ($LASTDATE)\a" + #echo -ne "\e]0;$LOCALNAME $HOST:$WD$ TODO ($LASTDATE)\a" fi - export LASTCMD=$1 + export LASTCMD="$(echo \"$1\" | tr -d '\n')" CMD=${1%% *} case $CMD in sudo) @@ -179,9 +180,8 @@ function precmd () { local WD="$(pwd | sed "s/^\/home\/$USER/~/")" if [ -n "$LASTCMD" ] then - #TODO - #echo -ne "\e]0;$LOCALNAME $HOST:$WD$ (was $LASTCMD $LASTDATE) `date +%T`\a" - echo -ne "\e]0;$LOCALNAME $HOST:$WD$ (was TODO $LASTDATE) `date +%T`\a" + echo -ne "\e]0;$LOCALNAME $HOST:$WD$ (was $LASTCMD $LASTDATE) `date +%T`\a" + #echo -ne "\e]0;$LOCALNAME $HOST:$WD$ (was TODO $LASTDATE) `date +%T`\a" else echo -ne "\e]0;urxvtc ready\a" fi