From 549f76fb96731fb365ef0b0117aaa07315662290 Mon Sep 17 00:00:00 2001 From: hanez Date: Mon, 16 Nov 2026 05:40:41 +0100 Subject: [PATCH] Some update. --- .zsh/functions.d/aliases.sh | 2 +- .zsh/functions.d/moerx.sh | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.zsh/functions.d/aliases.sh b/.zsh/functions.d/aliases.sh index c237f6a7..369f4004 100644 --- a/.zsh/functions.d/aliases.sh +++ b/.zsh/functions.d/aliases.sh @@ -28,7 +28,7 @@ alias lla='ls --color -la' alias llh='ls --color -lh' alias llah='ls --color -lah' -alias m='moerx --prefix x --status bottom' +alias m='moerx --prefix x --status bottom --no-moerx' alias n='nnn -diUxe' diff --git a/.zsh/functions.d/moerx.sh b/.zsh/functions.d/moerx.sh index c5005b66..010d07a2 100644 --- a/.zsh/functions.d/moerx.sh +++ b/.zsh/functions.d/moerx.sh @@ -1,8 +1,6 @@ -if [[ -n $SSH_CONNECTION ]]; then +if [[ -o interactive && ( -n $SSH_CONNECTION || $TERM == screen-256color ) ]]; then autoload -Uz add-zsh-hook moerx_ssh_title() { - emulate -L zsh - setopt typesetsilent local program=${1:t} printf '\033]2;%s:%s\007' "${HOST%%.*}" "$program" local directory=$PWD @@ -12,14 +10,15 @@ if [[ -n $SSH_CONNECTION ]]; then directory="~/${directory#"$HOME/"}" fi printf '\033]777;moerx-cwd;%s\007' "$directory" + printf '\033]777;moerx-root;%s\007' "$((EUID == 0))" } moerx_ssh_preexec() { - emulate -L zsh - setopt typesetsilent - local -a command_words=(${(z)1}) - moerx_ssh_title "${(Q)command_words[1]}" + 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 +