red user and hostname for root sessions

This commit is contained in:
Carlos Galindo 2021-02-06 19:04:09 +01:00
parent 9e11d79a1a
commit 2ce2815a4c

View file

@ -1,7 +1,12 @@
function fish_prompt function fish_prompt
if [ $USER = "root" ]
set user (set_color --bold red)(whoami)(set_color normal)
set machine (set_color --bold red)(hostname| cut -d . -f 1)(set_color normal)
else
set user (set_color --bold cyan)(whoami)(set_color normal) set user (set_color --bold cyan)(whoami)(set_color normal)
set machine (set_color --bold blue)(hostname| cut -d . -f 1)(set_color normal) set machine (set_color --bold blue)(hostname| cut -d . -f 1)(set_color normal)
end
set -l realhome ~ set -l realhome ~
set directory (set_color --bold green)(echo $PWD | sed -e "s|^$realhome|~|")(set_color normal) set directory (set_color --bold green)(echo $PWD | sed -e "s|^$realhome|~|")(set_color normal)