Compare commits

...

2 Commits

Author SHA1 Message Date
Shaheen Gandhi d7096de9d4
Merge 44ade697bf into 05b11d8b92 2025-01-24 04:19:10 +01:00
Shaheen Gandhi 44ade697bf ssh: optimize detection 2024-10-15 22:45:19 -07:00
1 changed files with 2 additions and 1 deletions

View File

@ -8483,7 +8483,8 @@ _p9k_init_ssh() {
# When changing user on a remote system, the $SSH_CONNECTION environment variable can be lost. # When changing user on a remote system, the $SSH_CONNECTION environment variable can be lost.
# Attempt detection via `who`. # 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 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. local ipv4='([0-9]{1,3}\.){3}[0-9]+' # Simplified, allows invalid ranges.