20 lines
716 B
Fish
20 lines
716 B
Fish
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
|