From 344d53103da67aebcb956dce6114bcf7c4488059 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 7 Aug 2022 18:41:26 +0300 Subject: feat(zsh): use red color for root prompt --- zsh/.zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 9105e9b..69afe27 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,7 +1,14 @@ autoload -U colors && colors -PS1="%B%{$fg[white]%}[%{$fg[cyan]%}%n%{$fg[white]%}@%{$fg[green]%}%M %{$fg[yellow]%}%~%{$fg[white]%}]%{$reset_color%}$%b " bindkey -e +# Shell prompt +if [ $(id -u) -eq 0 ]; +then # you are root, set red colour prompt + PS1="%B%{$fg[white]%}[%{$fg[red]%}%n%{$fg[white]%}@%{$fg[green]%}%M %{$fg[yellow]%}%~%{$fg[white]%}]%{$reset_color%}$%b " +else + PS1="%B%{$fg[white]%}[%{$fg[cyan]%}%n%{$fg[white]%}@%{$fg[green]%}%M %{$fg[yellow]%}%~%{$fg[white]%}]%{$reset_color%}$%b " +fi + # History in cache directory: export HISTSIZE=10000 export SAVEHIST=10000000 -- cgit v1.2.3