From 2ce2815a4ce65f878a4e33112b55310c29478810 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sat, 6 Feb 2021 19:04:09 +0100 Subject: [PATCH] red user and hostname for root sessions --- fish_prompt.fish | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 93025fd..a0a63ae 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -1,7 +1,12 @@ function fish_prompt - set user (set_color --bold cyan)(whoami)(set_color normal) + 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 machine (set_color --bold blue)(hostname| cut -d . -f 1)(set_color normal) + end - set machine (set_color --bold blue)(hostname| cut -d . -f 1)(set_color normal) set -l realhome ~ set directory (set_color --bold green)(echo $PWD | sed -e "s|^$realhome|~|")(set_color normal)