support short hostnames in xterm title
This commit is contained in:
@@ -8,11 +8,11 @@ set_xterm_title () {
|
|||||||
|
|
||||||
|
|
||||||
precmd () {
|
precmd () {
|
||||||
set_xterm_title "${USER}@${HOSTNAME} `dirs -0` $PROMPTCHAR"
|
set_xterm_title "${USER}@${SHORT_HOSTNAME:-${HOSTNAME}} `dirs -0` $PROMPTCHAR"
|
||||||
}
|
}
|
||||||
|
|
||||||
preexec () {
|
preexec () {
|
||||||
set_xterm_title "$1 {`dirs -0`} (${USER}@${HOSTNAME})"
|
set_xterm_title "$1 {`dirs -0`} (${USER}@${SHORT_HOSTNAME:-${HOSTNAME}})"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ export TODO="t"
|
|||||||
# Set this to false to turn off version control status checking within the prompt for all themes
|
# Set this to false to turn off version control status checking within the prompt for all themes
|
||||||
export SCM_CHECK=true
|
export SCM_CHECK=true
|
||||||
|
|
||||||
|
# Set Xterm/screen/Tmux title with only a short hostname.
|
||||||
|
# Comment this (or unset SHORT_HOSTNAME) to fall back on $HOSTNAME.
|
||||||
|
|
||||||
|
export SHORT_HOSTNAME=$(hostname -s)
|
||||||
|
|
||||||
# Set vcprompt executable path for scm advance info in prompt (demula theme)
|
# Set vcprompt executable path for scm advance info in prompt (demula theme)
|
||||||
# https://github.com/djl/vcprompt
|
# https://github.com/djl/vcprompt
|
||||||
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
|
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
|
||||||
|
|||||||
Reference in New Issue
Block a user