Making zsh set the title bar of its window, Cygwin or xterm?

Zajcev Evgeny zevlg at yandex.ru
Thu Dec 8 07:18:24 EST 2005


Ben Wing <ben at 666.com> writes:

> I'm really trying to do this under Cygwin, but if someone has ideas
> concerning xterm, it might help too.  I want zsh to change the title
> bar of the window it's in whenever it runs a command.
>

I use zsh's precmd() and preexec() functions to do the job, like this:

  if [ x$WINDOW != x ]; then
      # Running under screen(1)
      precmd () { print -Pn "\e]0;%n@%m:%l [W$WINDOW] [%?]\a" }
      preexec () { print -Pn "\e]0;%n@%m:%l [W$WINDOW] [$1]\a" }
  else
      precmd () { print -Pn "\e]0;%n@%m:%l [%?]\a" }
      preexec () { print -Pn "\e]0;%n@%m:%l [$1]\a" }
  fi

Hope this will help you

-- 
lg




More information about the XEmacs-Beta mailing list