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