From 17d3dc78feab175fb57d3e2b3b481f7b29d6c89b Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 13:37:22 +0100 Subject: [PATCH 1/2] pick up `ifconfig` and `ip` from PATH Apparently there are systems on which these tools are not in /sbin. Fixes #472. --- internal/p10k.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 03558340..7d690498 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4569,8 +4569,8 @@ function _p9k_prompt_net_iface_compute() { function _p9k_prompt_net_iface_async() { local iface ip line var typeset -a iface2ip - if [[ -x /sbin/ifconfig ]]; then - for line in ${(f)"$(/sbin/ifconfig 2>/dev/null)"}; do + if (( $+commands[ifconfig] )); then + for line in ${(f)"$(command ifconfig 2>/dev/null)"}; do if [[ $line == (#b)([^[:space:]]##):[[:space:]]##flags=(<->)'<'* ]]; then [[ $match[2] == *[13579] ]] && iface=$match[1] || iface= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then @@ -4578,8 +4578,8 @@ function _p9k_prompt_net_iface_async() { iface= fi done - elif [[ -x /sbin/ip ]]; then - for line in ${(f)"$(/sbin/ip -4 a show 2>/dev/null)"}; do + elif (( $+commands[ip] )); 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= elif [[ -n $iface && $line == (#b)[[:space:]]##inet[[:space:]]##([0-9.]##)* ]]; then From d17c7278a5ac8f0273ff8ae6ee9d997bff959891 Mon Sep 17 00:00:00 2001 From: romkatv Date: Thu, 6 Feb 2020 15:31:38 +0100 Subject: [PATCH 2/2] spello --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd04de9d..d32e7123 100644 --- a/README.md +++ b/README.md @@ -1086,7 +1086,7 @@ See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). See [cursor is in the wrong place](#cursor-is-in-the-wrong-place). -### Configuration wizard run automatically every time Zsh is started +### Configuration wizard runs automatically every time Zsh is started When Powerlevel10k starts, it automatically runs `p10k configure` if no `POWERLEVEL9K_*` parameters are defined. Based on your prompt style choices, the configuration wizard creates @@ -1426,7 +1426,7 @@ There are a few mitigation options for this issue. - [Cursor is in the wrong place](#cursor-is-in-the-wrong-place) - [Prompt wrapping around in a weird way](#prompt-wrapping-around-in-a-weird-way) - [Right prompt is in the wrong place](#right-prompt-is-in-the-wrong-place) - - [Configuration wizard run automatically every time Zsh is started](#configuration-wizard-run-automatically-every-time-zsh-is-started) + - [Configuration wizard runs automatically every time Zsh is started](#configuration-wizard-runs-automatically-every-time-zsh-is-started) - [Some prompt styles are missing from the configuration wizard](#some-prompt-styles-are-missing-from-the-configuration-wizard) - [Cannot install the recommended font](#cannot-install-the-recommended-font) - [Extra or missing spaces in prompt compared to Powerlevel9k](#extra-or-missing-spaces-in-prompt-compared-to-powerlevel9k)