mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Added parameter for fixed title
This commit is contained in:
parent
3d5b3430fd
commit
fb31140e3e
2 changed files with 6 additions and 6 deletions
|
|
@ -30,7 +30,7 @@ function omz_termsupport_precmd {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
|
title ${MANUAL_TITLE:-$ZSH_THEME_TERM_TAB_TITLE_IDLE} ${MANUAL_TITLE:-$ZSH_THEME_TERM_TITLE_IDLE}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Runs before executing the command
|
# Runs before executing the command
|
||||||
|
|
@ -43,8 +43,8 @@ function omz_termsupport_preexec {
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
|
|
||||||
# cmd name only, or if this is sudo or ssh, the next cmd
|
# cmd name only, or if this is sudo or ssh, the next cmd
|
||||||
local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%}
|
local CMD=${MANUAL_TITLE:-${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%}}
|
||||||
local LINE="${2:gs/%/%%}"
|
local LINE=${MANUAL_TITLE:-"${2:gs/%/%%}"}
|
||||||
|
|
||||||
title '$CMD' '%100>...>$LINE%<<'
|
title '$CMD' '%100>...>$LINE%<<'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,13 +42,13 @@ if [[ "$TERM" == screen* ]]; then
|
||||||
local -a cmd; cmd=(${(z)1}) # the command string
|
local -a cmd; cmd=(${(z)1}) # the command string
|
||||||
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC"
|
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC"
|
||||||
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC"
|
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC"
|
||||||
screen_set $tab_title $tab_hardstatus
|
screen_set ${MANUAL_TITLE:-$tab_title} ${MANUAL_TITLE:-$tab_hardstatus}
|
||||||
}
|
}
|
||||||
# called by zsh before showing the prompt
|
# called by zsh before showing the prompt
|
||||||
function precmd()
|
function precmd()
|
||||||
{
|
{
|
||||||
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT"
|
eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT"
|
||||||
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT"
|
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT"
|
||||||
screen_set $tab_title $tab_hardstatus
|
screen_set ${MANUAL_TITLE:-tab_title} ${MANUAL_TITLE:-$tab_hardstatus}
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue