dmitri alenitchev

September 17, 2006

zsh and xterm window title

Filed under: FreeBSD, OpenBSD, Ubuntu — Dmitri Alenitchev @ 16:55

If you want see information from your shell (like current directory, user and hostname) in xterm window title just place the following lines in your ~/.zshrc file:

case $TERM in
    *xterm*)
        precmd () {print -Pn "\e]0;%n@%M: %~\a"}
        ;;
esac

P.S.: I use “*xterm*” in this example, because i have TERM like “color_xterm”, “xterm-sun” and “xterm-hp”, see /etc/termcap file.

Blog at WordPress.com.