From 44ade697bf479566018fb729fdb459628bdb42e1 Mon Sep 17 00:00:00 2001 From: Shaheen Gandhi Date: Tue, 15 Oct 2024 22:45:19 -0700 Subject: [PATCH] ssh: optimize detection --- internal/p10k.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 0942c1c1..b50b88cd 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -8479,7 +8479,8 @@ _p9k_init_ssh() { # When changing user on a remote system, the $SSH_CONNECTION environment variable can be lost. # Attempt detection via `who`. - (( $+commands[who] )) || return + [[ -z "$(command -v who)" ]] && return + #(( $+commands[who] )) || return local ipv6='(([0-9a-fA-F]+:)|:){2,}[0-9a-fA-F]+' # Simplified, only checks partial pattern. local ipv4='([0-9]{1,3}\.){3}[0-9]+' # Simplified, allows invalid ranges.