Hi, you have to substitute the % with %% Change the line : __last_cmd=$1 in something like that: __last_cmd=`echo $1 | sed -e "s/%/%%/g"` this should do the job. Stefan Von: Guillaume Brunerie An: zsh-users@zsh.org Datum: 19.08.2010 16:51 Betreff: Setting the terminal title: problem with percent signs Hi, I have the following in my .zshrc which set the terminal title to "*cmd" when cmd is executed and to "(cmd)" when execution of cmd is over. __last_cmd= preexec () { __last_cmd=$1 print -Pn "\e]0;*$__last_cmd\a" } precmd () { if [[ -n $__last_cmd ]] then print -Pn "\e]0;($__last_cmd)\a" fi } (print -Pn "\e]0;$str\a" change the terminal title to $str, see 'man console_codes') It works well, except when there are percent signs in the last command. For example if I type "echo 100%", the terminal title becomes "(echo 100)" instead of "(echo 100%)" and the string " ]0;*echo 100100%" appears in the terminal. How can I do to make it work even with percent signs in the command? Thank you Guillaume Brunerie