diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index e82ce7b..23a4040 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -130,16 +130,16 @@ case ${TERM} in DISABLE_AUTO_TITLE="true" # Write some info to terminal title. # This is seen when the shell prompts for input. - function precmd_title { + function _my_title_precmd() { print -Pn "\e]0;%m: %(1j,%j job%(2j|s|); ,)%~\a" } - precmd_functions+=precmd_title + add-zsh-hook precmd _my_title_precmd # Write command and args to terminal title. # This is seen while the shell waits for a command to complete. - function preexec_title { + function _my_title_preexec() { printf "\e]0;%s: %s; %s\a" "${HOST}" "${1}" "$(print -Pn %~)" } - preexec_functions+=preexec_title + add-zsh-hook preexec _my_title_preexec # # Enable TrueColor. # if [[ "${COLORTERM}" = "truecolor" || "${TERM}" =~ "24bit" ]]; then @@ -187,10 +187,6 @@ case $(hostname) in ;; esac -# Make sure each function is only called 1 time. -precmd_functions=(${(u)precmd_functions}) -preexec_functions=(${(u)preexec_functions}) - [[ -f "${ZDOTDIR}"/zkeys ]] && source "${ZDOTDIR}"/zkeys [[ -f "${ZDOTDIR}"/zaliases ]] && source "${ZDOTDIR}"/zaliases [[ -d "${ZDOTDIR}"/functions ]] && autoload -Uz "${ZDOTDIR}"/functions/* diff --git a/.config/zsh/themes/prompt.zsh b/.config/zsh/themes/prompt.zsh index ffbd508..5ae9ff7 100644 --- a/.config/zsh/themes/prompt.zsh +++ b/.config/zsh/themes/prompt.zsh @@ -69,6 +69,7 @@ function async_vcs_prompt() } _my_vcs_async_start + autoload -Uz add-zsh-hook add-zsh-hook precmd _my_vcs_precmd add-zsh-hook chpwd _my_vcs_chpwd }