diff --git a/fish_cfg/functions/prompt_login.fish b/fish_cfg/functions/prompt_login.fish new file mode 100644 index 0000000..0efb9c6 --- /dev/null +++ b/fish_cfg/functions/prompt_login.fish @@ -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