Zsh: Rename jobs_dir variable and make it local

This commit is contained in:
tastytea 2022-03-27 00:34:37 +01:00
parent 245fba9192
commit bfecb170c2
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -104,8 +104,9 @@ if tput tsl > /dev/null; then
# Write command and args to terminal title.
# This is seen while the shell waits for a command to complete.
function _my_title_preexec() {
print -Pnv jobs_dir "%(1j,%j job%(2j|s|); ,)%~"
printf "\e]0;%s: %s; %s\a" "${HOST}" "${1}" "${jobs_dir}"
local _my_jobs_dir
print -Pnv _my_jobs_dir "%(1j,%j job%(2j|s|); ,)%~"
printf "\e]0;%s: %s; %s\a" "${HOST}" "${1}" "${_my_jobs_dir}"
}
add-zsh-hook preexec _my_title_preexec
fi