zsh title: show host only on ssh
This commit is contained in:
parent
688a4b5eda
commit
8944348eee
@ -24,18 +24,38 @@
|
|||||||
|
|
||||||
|
|
||||||
case $TERM in
|
case $TERM in
|
||||||
*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term)
|
*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term)
|
||||||
precmd () { print -Pn "\e]0;[%n@%M][%~]%#\a" }
|
precmd () {
|
||||||
preexec () { print -Pn "\e]0;[%n@%M][%~]%# ($1)\a" }
|
if [[ -v SSH_CONNECTION ]]; then
|
||||||
;;
|
print -Pn "\e]0;[%n@%M][%~]#\a"
|
||||||
screen)
|
else
|
||||||
precmd () {
|
print -Pn "\e]0;[%~]#\a"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
preexec () {
|
||||||
|
if [[ -v SSH_CONNECTION ]]; then
|
||||||
|
print -Pn "\e]0;[%n@%M][%~]# ($1)\a"
|
||||||
|
else
|
||||||
|
print -Pn "\e]0;[%~]# ($1)\a"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
;;
|
||||||
|
screen)
|
||||||
|
precmd () {
|
||||||
print -Pn "\e]83;title \"$1\"\a"
|
print -Pn "\e]83;title \"$1\"\a"
|
||||||
print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a"
|
if [[ -v SSH_CONNECTION ]]; then
|
||||||
|
print -Pn "\e]0;$TERM - (%L) [%n@%M]# [%~]\a"
|
||||||
|
else
|
||||||
|
print -Pn "\e]0;$TERM - (%L)# [%~]\a"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
preexec () {
|
preexec () {
|
||||||
print -Pn "\e]83;title \"$1\"\a"
|
print -Pn "\e]83;title \"$1\"\a"
|
||||||
print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a"
|
if [[ -v SSH_CONNECTION ]]; then
|
||||||
|
print -Pn "\e]0;$TERM - (%L) [%n@%M]# [%~] ($1)\a"
|
||||||
|
else
|
||||||
|
print -Pn "\e]0;$TERM - (%L) # [%~] ($1)\a"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user