zsh: shorten window title
This commit is contained in:
parent
4724527b74
commit
650a1b0e21
1 changed files with 5 additions and 4 deletions
|
@ -35,6 +35,11 @@ prompt.set_bang() {
|
|||
prompt_symbols[bang]=$1
|
||||
}
|
||||
|
||||
precmd.window_title() {
|
||||
typeset dir=$(pwd)
|
||||
printf '\033]0;%s:%s\007' ${HOST%%.*} ${dir##*/}
|
||||
}
|
||||
|
||||
precmd.is_git_repo() {
|
||||
typeset prompt_git_dir
|
||||
prompt_git_dir=$(git rev-parse --git-dir 2>/dev/null) || return 1
|
||||
|
@ -132,10 +137,6 @@ precmd.prompt.update() {
|
|||
zle && zle reset-prompt
|
||||
}
|
||||
|
||||
precmd.window_title() {
|
||||
printf '\033]0;%s %s\007' ${HOST%%.*} $(pwd)
|
||||
}
|
||||
|
||||
precmd() {
|
||||
precmd.window_title
|
||||
if precmd.is_git_repo; then
|
||||
|
|
Loading…
Reference in a new issue