Added prompt_login for old fish shell and customisation of prompt_login

This commit is contained in:
Dirk Alders 2025-03-02 16:47:21 +01:00
parent 7f1e2bd034
commit 4f54b9ebfe

View File

@ -0,0 +1,19 @@
function prompt_login --description 'display user name for the prompt'
# If we're running as root, change the user color and the seperator
if functions -q fish_is_root_user; and fish_is_root_user
if set -q fish_color_cwd_root
set fish_color_user $fish_color_cwd_root
end
set seperator '☠'
else
set seperator '@'
end
# If we're running via SSH, change the host color.
set -l color_host $fish_color_host
if set -q SSH_TTY; and set -q fish_color_host_remote
set color_host $fish_color_host_remote
end
echo -n -s (set_color $fish_color_user) "$USER" (set_color normal) $seperator (set_color $color_host) (prompt_hostname) (set_color normal)
end