z_mirror/dotfiles
git clone https://git.raiguard.me/z_mirror/dotfiles
464c06e
trunk
1function fish_prompt --description'Write out the prompt' 2set -l last_pipestatus$pipestatus 3set -lx __fish_last_status$status # Export for __fish_print_pipestatus. 4set -l normal( set_color --reset) 5 6# Color the prompt differently when we're root 7set -l color_cwd$fish_color_cwd 8set -l suffix'>' 9if functions -q fish_is_root_user;and fish_is_root_user 10if set -q fish_color_cwd_root 11set color_cwd$fish_color_cwd_root 12end 13set suffix'#' 14end 15 16# Write pipestatus 17# If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. 18set -l bold_flag --bold 19set -q __fish_prompt_status_generation;or set -g __fish_prompt_status_generation$status_generation 20if test $__fish_prompt_status_generation = $status_generation 21set bold_flag 22end 23set __fish_prompt_status_generation$status_generation 24set -l status_color( set_color $fish_color_status ) 25set -l statusb_color( set_color $bold_flag $fish_color_status ) 26set -l prompt_status( __fish_print_pipestatus "[" "]" "|" " $status_color " " $statusb_color " $last_pipestatus ) 27 28echo -n -s( prompt_login ) ' ' ( set_color $color_cwd ) ( prompt_pwd ) $normal ( fish_vcs_prompt ) $normal " " $prompt_status $suffix " " 29end