1
0
Fork 0

Zsh: Remove o-m-z variable, fix preexec terminal title

Can't get number of jobs from subshell, so we put them in a variable.
This commit is contained in:
tastytea 2022-03-26 23:24:03 +01:00
parent 0c0beeb071
commit 9b4035393a
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,6 @@ EOF
case ${TERM} in
(xterm* | tmux* | rxvt* | screen* | alacritty)
DISABLE_AUTO_TITLE="true"
# Write some info to terminal title.
# This is seen when the shell prompts for input.
function _my_title_precmd() {
@ -136,7 +135,8 @@ case ${TERM} in
# Write command and args to terminal title.
# This is seen while the shell waits for a command to complete.
function _my_title_preexec() {
printf "\e]0;%s: %s; %s\a" "${HOST}" "${1}" "$(print -Pn %~)"
print -Pnv jobs_dir "%(1j,%j job%(2j|s|); ,)%~"
printf "\e]0;%s: %s; %s\a" "${HOST}" "${1}" "${jobs_dir}"
}
add-zsh-hook preexec _my_title_preexec