xterm.plugin.bash: reformat to follow bash-it code style
parent
597285cdfd
commit
9435a68695
|
|
@ -2,12 +2,12 @@ cite about-plugin
|
||||||
about-plugin 'automatically set your xterm title with host and location info'
|
about-plugin 'automatically set your xterm title with host and location info'
|
||||||
|
|
||||||
|
|
||||||
short_dirname () {
|
_short-dirname () {
|
||||||
local dir_name=`dirs -0`
|
local dir_name=`dirs -0`
|
||||||
[ "$SHORT_TERM_LINE" = true ] && [ ${#dir_name} -gt 8 ] && echo ${dir_name##*/} || echo $dir_name
|
[ "$SHORT_TERM_LINE" = true ] && [ ${#dir_name} -gt 8 ] && echo ${dir_name##*/} || echo $dir_name
|
||||||
}
|
}
|
||||||
|
|
||||||
short_command () {
|
_short-command () {
|
||||||
local input_command="$@"
|
local input_command="$@"
|
||||||
[ "$SHORT_TERM_LINE" = true ] && [ ${#input_command} -gt 8 ] && echo ${input_command%% *} || echo $input_command
|
[ "$SHORT_TERM_LINE" = true ] && [ ${#input_command} -gt 8 ] && echo ${input_command%% *} || echo $input_command
|
||||||
}
|
}
|
||||||
|
|
@ -18,11 +18,11 @@ set_xterm_title () {
|
||||||
}
|
}
|
||||||
|
|
||||||
precmd () {
|
precmd () {
|
||||||
set_xterm_title "${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}} `short_dirname` $PROMPTCHAR"
|
set_xterm_title "${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}} `_short-dirname` $PROMPTCHAR"
|
||||||
}
|
}
|
||||||
|
|
||||||
preexec () {
|
preexec () {
|
||||||
set_xterm_title "$(short_command $1) {`short_dirname`} (${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}})"
|
set_xterm_title "`_short-command $1` {`_short-dirname`} (${SHORT_USER:-${USER}}@${SHORT_HOSTNAME:-${HOSTNAME}})"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue