support short hostnames in xterm title

This commit is contained in:
Ira Abramov
2016-11-06 13:44:49 +02:00
parent 62eb23f302
commit 2a0700d700
2 changed files with 7 additions and 2 deletions

View File

@@ -8,11 +8,11 @@ set_xterm_title () {
precmd () {
set_xterm_title "${USER}@${HOSTNAME} `dirs -0` $PROMPTCHAR"
set_xterm_title "${USER}@${SHORT_HOSTNAME:-${HOSTNAME}} `dirs -0` $PROMPTCHAR"
}
preexec () {
set_xterm_title "$1 {`dirs -0`} (${USER}@${HOSTNAME})"
set_xterm_title "$1 {`dirs -0`} (${USER}@${SHORT_HOSTNAME:-${HOSTNAME}})"
}
case "$TERM" in