1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

minor bug fix in nordvpn plus cleanup of the same

This commit is contained in:
romkatv 2020-02-10 15:20:52 +01:00
parent b86eb6a037
commit 6f4840b463

View file

@ -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 {