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