support cpu_arch on Linux

Linux does not have `arch` or `machine`, so we read from /proc instead.
This commit is contained in:
Gamma 2024-10-17 08:18:34 -05:00 committed by GitHub
parent 0996a94118
commit 4bf8882b5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -5751,6 +5751,8 @@ prompt_cpu_arch() {
if _p9k_cache_ephemeral_get $0; then if _p9k_cache_ephemeral_get $0; then
state=$_p9k__cache_val[1] state=$_p9k__cache_val[1]
text=$_p9k__cache_val[2] text=$_p9k__cache_val[2]
elif [[ $_p9k_os == (Linux|Android) ]]; then
text=$(</proc/sys/kernel/arch)
else else
local cmd local cmd
for cmd in machine arch; do for cmd in machine arch; do