1
0
Fork 0

zsh: shorten window title

This commit is contained in:
Von Random 2024-05-22 10:50:56 +03:00
parent 4724527b74
commit 650a1b0e21

View file

@ -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