Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

More on zsh user's guide formatting glitch



In 3.3.3: compiling functions, Special functions:


  chpwd() {
    [[ -t 1 ]] || return
    case $TERM in
      sun-cmd

print -Pn "\e]l%~\e\\" ;; *xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;%~\a" ;;
esac } ) The first line tests that standard output is really a terminal ---
you don't want

i.e. formatting is broken.

Hmm ... in my experience, setting title in chpwd() turned out to be
suboptimal. If any external program (zsh subshell including) changed your
title, zsh won't notice it until next cd. So, I finally decided in favour of
preexec(). May be, trapping child exits could do the job, but it looks just
too complicated for this simple task.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author