Some .zsh updates.
This commit is contained in:
parent
ee2bfa3922
commit
d05471722f
1 changed files with 6 additions and 4 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
if [[ -n $SSH_CONNECTION ]]; then
|
if [[ -n $SSH_CONNECTION ]]; then
|
||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
moerx_ssh_title() {
|
moerx_ssh_title() {
|
||||||
|
emulate -L zsh
|
||||||
|
setopt typesetsilent
|
||||||
local program=${1:t}
|
local program=${1:t}
|
||||||
printf '\033]2;%s:%s\007' "${HOST%%.*}" "$program"
|
printf '\033]2;%s:%s\007' "${HOST%%.*}" "$program"
|
||||||
local directory=$PWD
|
local directory=$PWD
|
||||||
|
|
@ -12,12 +14,12 @@ if [[ -n $SSH_CONNECTION ]]; then
|
||||||
printf '\033]777;moerx-cwd;%s\007' "$directory"
|
printf '\033]777;moerx-cwd;%s\007' "$directory"
|
||||||
}
|
}
|
||||||
moerx_ssh_preexec() {
|
moerx_ssh_preexec() {
|
||||||
local -a words
|
emulate -L zsh
|
||||||
words=(${(z)1})
|
setopt typesetsilent
|
||||||
moerx_ssh_title "${(Q)words[1]}"
|
local -a command_words=(${(z)1})
|
||||||
|
moerx_ssh_title "${(Q)command_words[1]}"
|
||||||
}
|
}
|
||||||
moerx_ssh_precmd() { moerx_ssh_title zsh; }
|
moerx_ssh_precmd() { moerx_ssh_title zsh; }
|
||||||
add-zsh-hook preexec moerx_ssh_preexec
|
add-zsh-hook preexec moerx_ssh_preexec
|
||||||
add-zsh-hook precmd moerx_ssh_precmd
|
add-zsh-hook precmd moerx_ssh_precmd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue