Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 949 forks source link

[Bugfix] Fix failed attempt to open nonexistent `/proc/1/stat`. #1336

Closed goddessfreya closed 5 years ago

goddessfreya commented 5 years ago

Fix failed attempt to open nonexistent /proc/1/stat.

Previously, when a terminal is not found, it climbs up the proccess tree until it tries to open /proc/1/stat and fails with __p9k_detect_terminal:23: no such file or directory: /proc/1/stat.

This appears to be harmless, but gives an annoying error whenever starting zsh.

Sliding the pid check before the proc_stat=(${(@f)$(</proc/${pid}/stat)}) solved this problem.

Also adds xfce4-terminal to list of terminal emulators.

Signed-off-by: Hal Gentz zegentzy@protonmail.com

Btw, I'm liking this new next branch. The time between prompts showing up has gone from a sluggish ~0.5s to a wonderful ~0.05s. Thank you!

dritter commented 5 years ago

Hey @ZeGentzy ,

Thanks for the PR and welcome to P9K! Glad you like it!