From ddf968f1654a8ba6e358991373e57a820a94a0ad Mon Sep 17 00:00:00 2001 From: Hal Gentz Date: Wed, 31 Jul 2019 01:06:30 -0600 Subject: [PATCH] Fix failed attempt to open proc files while lacking permission. When started in the tty, powerline9k tries to open the stat file of the `login` process. Because the `login` process belongs to root, it's existence is hidden from non-privileged users. This will result in an error like `__p9k_detect_terminal:27: no such file or directory: /proc/3434/stat`. Signed-off-by: Hal Gentz --- functions/utilities.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/utilities.zsh b/functions/utilities.zsh index f729f8a44..288d4cb02 100755 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -101,7 +101,7 @@ function __p9k_detect_terminal() { fi local pid=$$ termtest='' while true; do - if test "$pid" = "1" -o "$pid" = ""; then + if test "$pid" = "1" -o "$pid" = "" -o ! -d /proc/${pid}; then __P9K_TERMINAL="unknown" return fi