CPU load scale is off on MacOS
Created by: alyssais
Shell: zsh Operating system: macOS Liquid Prompt version (tag, commit): 1.11
Often the CPU load percentage reported by liquidprompt is well over 100%. This means it won't be coloured by the gradient scale.
I've investigated a bit and found that liquidprompt uses
sysctl -n vm.loadavg to find the current CPU usage, then it divides it by the number returned from
sysctl -n ncpu (in my case this is 4) and multiplies by 100.
The values from
sysctl -n vm.loadavg can be well over 400%, though. I've seen it as high as
10.88. So, it looks like liquidprompt is using the wrong value as the upper bound (though I couldn't tell you what that should be).