summaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-10 17:20:52 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-10 17:20:52 +0300
commit6f4840b4636666dcb639185181988084ba5c4ca5 (patch)
tree858dc63bf80b339031218b85f07b2674e0f38b1b /internal/p10k.zsh
parentb86eb6a037f637efa5d982f958184f39536d306d (diff)
minor bug fix in nordvpn plus cleanup of the same
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh13
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 42d279c9..a455d625 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4168,17 +4168,18 @@ function _p9k_fetch_nordvpn_status() {
(( (tag >>= 3) && tag <= $#__p9k_nordvpn_tag )) || break
tag=$__p9k_nordvpn_tag[tag]
[[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html
- sysread -c n -s 1 -t 0.25 len
+ sysread -s 1 -t 0.25 len
len=$((#len))
val=
- (( ! len )) || {
+ while true; do
+ (( len )) || break
[[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html
- sysread -c n -s $len -t 0.25 val
- (( n == len ))
- }
+ sysread -c n -s $len -t 0.25 'val[$#val+1]'
+ len+=-n
+ done
typeset -g $tag=$val
[[ -t $fd ]] || true # https://www.zsh.org/mla/workers/2020/msg00207.html
- sysread -c n -s 1 -t 0.25 tag
+ sysread -s 1 -t 0.25 tag
done
} <&$fd
} always {