diff --git a/zsh/zshrc b/zsh/zshrc index c8b4db9..7c5b015 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -19,6 +19,18 @@ fpath=( "$fpath[@]" ) +# Title +autoload -Uz add-zsh-hook +function _set_title() { + echo -ne "\033]0; ${USER}@${HOST} \007" +} +function _set_cmd_title() { + cmd=$(echo ${2} | awk '{print $1}') + echo -ne "\033]0; ${cmd} \007" +} +add-zsh-hook precmd _set_title +add-zsh-hook preexec _set_cmd_title + # Check required app ## editor if ( ! $(command -v nvim > /dev/null) )