set -g VIRTUAL_ENV_DISABLE_PROMPT true set -g __fish_git_prompt_showdirtystate true set -g __fish_git_prompt_showcolorhints true set -g __fish_git_prompt_showupstream auto set -g __fish_git_prompt_char_stateseparator '' function fish_prompt --description 'Write out the prompt' set -l last_pipestatus $pipestatus set -lx __fish_last_status $status # Export for __fish_print_pipestatus. set -l normal (set_color normal) set -q fish_color_status or set -g fish_color_status red # Get the current time in HHMM format set -l current_time (date '+%H%M') set -l time_color (set_color brblue) # Highlight root with bright red background set -l suffix '>' set -l user_color (set_color $fish_color_user) if fish_is_root_user set user_color $normal (set_color -b brred) set suffix '#' end # On remote connections color the host name set -l host_color $normal if set -q SSH_TTY set host_color $normal (set_color -b magenta) end # Write pipestatus set -l bold_flag --bold set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation if test $__fish_prompt_status_generation = $status_generation set bold_flag end set __fish_prompt_status_generation $status_generation set -l status_color (set_color $fish_color_status) set -l statusb_color (set_color $bold_flag $fish_color_status) set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) echo -n -s $time_color $current_time $normal echo -n -s $user_color (whoami) $host_color '@' (prompt_hostname) ':' $normal echo -n -s (set_color $fish_color_cwd) (prompt_pwd --full-length-dirs 3) $normal echo -n -s $prompt_status echo -n -s $suffix " " end function fish_right_prompt --description 'Right side prompt for Python venv and Git' set -l normal (set_color normal) # Show active Python virtual environment, if any if set -q VIRTUAL_ENV set -l venv (basename "$VIRTUAL_ENV") set -l venv_color (set_color cyan) echo -n -s "($venv_color$venv$normal)" end # Show Git branch and status set -l git_info (fish_vcs_prompt) if test -n "$git_info" echo -n -s "$git_info" end end function fish_greeting set -l normal (set_color normal) set -l greeting_color (set_color cyan) set -l login_type "💻 Local session on" # Detect if logged in via SSH if set -q SSH_TTY set greeting_color (set_color brmagenta) set login_type "🔮 SSH session on" end # Get system information set -l host (prompt_hostname) # Get system hostname # Display greeting with system information echo -e "$greeting_color$login_type $host$normal" echo end