mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-24 16:11:57 +00:00
fix network interface detection on macos (#2170)
This was broken in #2088.
This commit is contained in:
parent
21e89cb61d
commit
f03d917fb0
1 changed files with 1 additions and 1 deletions
|
@ -5744,7 +5744,7 @@ function _p9k_prompt_net_iface_async() {
|
|||
# netstat -inbI en0
|
||||
local iface ip line var
|
||||
typeset -a iface2ip ips ifaces
|
||||
if (( $+commands[ip] )); then
|
||||
if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE != linux* ]]; then
|
||||
for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do
|
||||
if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then
|
||||
[[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface=
|
||||
|
|
Loading…
Reference in a new issue