Skip to content

Commit

Permalink
Skip grep fork, use native zsh matching (#459)
Browse files Browse the repository at this point in the history
Also fixes $TTY match bug.
  • Loading branch information
xPMo authored and mafredri committed Feb 5, 2019
1 parent 40d7f19 commit 47f9bfd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ prompt_pure_state_setup() {
who_out=$(who -m 2>/dev/null)
if (( $? )); then
# Who am I not supported, fallback to plain who.
who_out=$(who 2>/dev/null | grep ${TTY#/dev/})
local -a who_in
who_in=( ${(f)"$(who 2>/dev/null)"} )
who_out="${(M)who_in:#*[[:space:]]${TTY#/dev/}[[:space:]]*}"
fi

local reIPv6='(([0-9a-fA-F]+:)|:){2,}[0-9a-fA-F]+' # Simplified, only checks partial pattern.
Expand Down

0 comments on commit 47f9bfd

Please sign in to comment.