From ec66e06c6e13e2d0e6d5e3b6dcd620efdba2d02c Mon Sep 17 00:00:00 2001 From: hanez Date: Sun, 15 Nov 2026 01:19:17 +0100 Subject: [PATCH] Added moerx features to Zsh. --- .zsh/functions.d/moerx.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .zsh/functions.d/moerx.sh diff --git a/.zsh/functions.d/moerx.sh b/.zsh/functions.d/moerx.sh new file mode 100644 index 00000000..e34af778 --- /dev/null +++ b/.zsh/functions.d/moerx.sh @@ -0,0 +1,16 @@ +if [[ -n $SSH_CONNECTION ]]; then + autoload -Uz add-zsh-hook + moerx_ssh_title() { + local program=${1:t} + printf '\033]2;%s:%s\007' "${HOST%%.*}" "$program" + } + moerx_ssh_preexec() { + local -a words + words=(${(z)1}) + moerx_ssh_title "${(Q)words[1]}" + } + moerx_ssh_precmd() { moerx_ssh_title zsh; } + add-zsh-hook preexec moerx_ssh_preexec + add-zsh-hook precmd moerx_ssh_precmd +fi +