# Runs whenever a command is ran function precmd () { builtin print -Pn "\e]0;${USER}@${HOST} %~\a" # Update window title builtin print -Pn "\e]7;file://${PWD}\a" # Update terminal emulators's cwd }