diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-08-07 18:41:26 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-08-07 18:41:26 +0300 |
commit | 344d53103da67aebcb956dce6114bcf7c4488059 (patch) | |
tree | 322fcf7cfdfa5f8508037be3241a5af9df2072a7 | |
parent | 3789dd4a4c7e9d7851538bb05d2797a70e6cea07 (diff) | |
download | dotfiles-344d53103da67aebcb956dce6114bcf7c4488059.tar.gz |
feat(zsh): use red color for root prompt
-rw-r--r-- | zsh/.zshrc | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |