aboutsummaryrefslogtreecommitdiff
path: root/zshrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'zshrc.d')
-rw-r--r--zshrc.d/prompt8
1 files changed, 7 insertions, 1 deletions
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