Merge pull request #942 from ontherunvaro/short-username

Support short username in xterm title plugin
pull/949/head
Nils Winkler 2017-04-25 08:53:42 +02:00 committed by GitHub
commit bb63f6a9a6
2 changed files with 7 additions and 2 deletions

View File

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

View File

@ -31,6 +31,11 @@ export SCM_CHECK=true
# Will otherwise fall back on $HOSTNAME. # Will otherwise fall back on $HOSTNAME.
#export SHORT_HOSTNAME=$(hostname -s) #export SHORT_HOSTNAME=$(hostname -s)
# Set Xterm/screen/Tmux title with only a short username.
# Uncomment this (or set SHORT_USER to something else),
# Will otherwise fall back on $USER.
#export SHORT_USER=${USER:0:8}
# 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