diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-03-03 20:17:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-03 20:17:01 +0100 |
commit | 02d12538090a8ed74ccb15ef976fca46adcde37b (patch) | |
tree | 97d3e0cdafd88e18da81038a4f9419c0e9e5bfd6 | |
parent | d7825313cca7ec4cfdd0cf64fb9b0119d52a4ab7 (diff) | |
download | zsh-02d12538090a8ed74ccb15ef976fca46adcde37b.tar.gz zsh-02d12538090a8ed74ccb15ef976fca46adcde37b.tar.bz2 zsh-02d12538090a8ed74ccb15ef976fca46adcde37b.zip |
lib: clean up termsupport.zsh
-rw-r--r-- | lib/termsupport.zsh | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 4d6fb8c21..d67223caa 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -32,10 +32,10 @@ function title { # Try to use terminfo to set the title # If the feature is available set title if [[ -n "$terminfo[fsl]" ]] && [[ -n "$terminfo[tsl]" ]]; then - echoti tsl - print -Pn "$1" - echoti fsl - fi + echoti tsl + print -Pn "$1" + echoti fsl + fi fi ;; esac @@ -50,24 +50,17 @@ fi # Runs before showing the prompt function omz_termsupport_precmd { - emulate -L zsh - - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return - fi - + [[ "$DISABLE_AUTO_TITLE" == true ]] && return title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE } # Runs before executing the command function omz_termsupport_preexec { + [[ "$DISABLE_AUTO_TITLE" == true ]] && return + emulate -L zsh setopt extended_glob - if [[ "$DISABLE_AUTO_TITLE" == true ]]; then - return - fi - # split command into array of arguments local -a cmdargs cmdargs=("${(z)2}") @@ -99,10 +92,9 @@ function omz_termsupport_preexec { esac # override preexec function arguments with job command - local job_cmd="${jobtexts[$job_id]}" - if [[ -n "$job_cmd" ]]; then - 1="$job_cmd" - 2="$job_cmd" + if [[ -n "${jobtexts[$job_id]}" ]]; then + 1="${jobtexts[$job_id]}" + 2="${jobtexts[$job_id]}" fi fi |