From 0dbd6d553796c263ca1c7ff919ed54387a39a2e1 Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 16 Sep 2021 06:22:07 +0200 Subject: force prompt hostname on root --- functions/fish_prompt.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions') diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index da5f604..ffd7da2 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -103,9 +103,9 @@ function prompt_user -d "Display current user if different from $default_user" end end -function get_hostname -d "Set current hostname to prompt variable $HOSTNAME_PROMPT if connected via SSH" +function get_hostname -d "Set current hostname to prompt variable $HOSTNAME_PROMPT if connected via SSH or is root" set -g HOSTNAME_PROMPT "" - if [ "$theme_hostname" = "always" -o \( "$theme_hostname" != "never" -a -n "$SSH_CLIENT" \) ] + if [ "$theme_hostname" = "always" -o \( "$theme_hostname" != "never" -a \( -n "$SSH_CLIENT" -o "$USER" = "root" \) \) ] set -g HOSTNAME_PROMPT (hostname) end end -- cgit v1.2.3