summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorache <ache@ache.one>2021-09-16 06:22:07 +0200
committerache <ache@ache.one>2021-09-16 06:22:07 +0200
commit0dbd6d553796c263ca1c7ff919ed54387a39a2e1 (patch)
treef72e1817fe958d13006fda030829a36fe952f586 /functions
parentSet android home (diff)
force prompt hostname on root
Diffstat (limited to 'functions')
-rw-r--r--functions/fish_prompt.fish4
1 files changed, 2 insertions, 2 deletions
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