mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 05:40:08 +00:00
lib: clean up termsupport.zsh
This commit is contained in:
parent
d7825313cc
commit
02d1253809
1 changed files with 10 additions and 18 deletions
|
@ -50,24 +50,17 @@ fi
|
||||||
|
|
||||||
# Runs before showing the prompt
|
# Runs before showing the prompt
|
||||||
function omz_termsupport_precmd {
|
function omz_termsupport_precmd {
|
||||||
emulate -L zsh
|
[[ "$DISABLE_AUTO_TITLE" == true ]] && return
|
||||||
|
|
||||||
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
||||||
}
|
}
|
||||||
|
|
||||||
# Runs before executing the command
|
# Runs before executing the command
|
||||||
function omz_termsupport_preexec {
|
function omz_termsupport_preexec {
|
||||||
|
[[ "$DISABLE_AUTO_TITLE" == true ]] && return
|
||||||
|
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
|
|
||||||
if [[ "$DISABLE_AUTO_TITLE" == true ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# split command into array of arguments
|
# split command into array of arguments
|
||||||
local -a cmdargs
|
local -a cmdargs
|
||||||
cmdargs=("${(z)2}")
|
cmdargs=("${(z)2}")
|
||||||
|
@ -99,10 +92,9 @@ function omz_termsupport_preexec {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# override preexec function arguments with job command
|
# override preexec function arguments with job command
|
||||||
local job_cmd="${jobtexts[$job_id]}"
|
if [[ -n "${jobtexts[$job_id]}" ]]; then
|
||||||
if [[ -n "$job_cmd" ]]; then
|
1="${jobtexts[$job_id]}"
|
||||||
1="$job_cmd"
|
2="${jobtexts[$job_id]}"
|
||||||
2="$job_cmd"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue