From a72880521555bff5a15f55bdd08fca9f3c414e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 21 Jul 2022 11:26:08 +0200 Subject: zshrc: color yellow if we are in nix shell --- zshrc.d/prompt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zshrc.d/prompt b/zshrc.d/prompt index 2f84536..33b81ef 100644 --- a/zshrc.d/prompt +++ b/zshrc.d/prompt @@ -3,7 +3,13 @@ # Disable default prompt command -v prompt >/dev/null && prompt off -[ $UID -eq 0 ] && NCOLOR="red" || NCOLOR="green" +if [ "$UID" -eq 0 ]; then + NCOLOR="red" +elif [ -n "$IN_NIX_SHELL" ]; then + NCOLOR="yellow" +else + NCOLOR="green" +fi PROMPT="%(?..%{$fg_bold[yellow]%}EXIT: %? )%{$fg_bold[$NCOLOR]%}%n@%m:%{$fg_bold[blue]%}%1~%{$fg_bold[$NCOLOR]%}%(!.#.$)%{$reset_color%} " unset NCOLOR -- cgit v1.2.3