function xtitle () { builtin print -n -- "\e]0;$@\a" } # Updates the window title whenever a command is run function precmd () { xtitle "$(print -P ${USER}@${HOST} %~)" }