fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
867946468
master
1# name: Astronaut 2# author: Radu Potop 3# description: A prompt theme similar to Starship.rs but without the emojis. 4 5function fish_prompt --description'Write out the prompt' 6set -l last_status$status 7set -l normal( set_color --reset) 8set -l status_color( set_color brgreen) 9set -l cwd_color( set_color $fish_color_cwd ) 10set -l vcs_color( set_color brpurple) 11set -l prompt_status"" 12 13# Since we display the prompt on a new line allow the directory names to be longer. 14set -q fish_prompt_pwd_dir_length 15or set -lx fish_prompt_pwd_dir_length0 16 17# Color the prompt differently when we're root 18set -l suffix'❯' 19if functions -q fish_is_root_user;and fish_is_root_user 20if set -q fish_color_cwd_root 21set cwd_color( set_color $fish_color_cwd_root ) 22end 23set suffix'#' 24end 25 26# Color the prompt in red on error 27if test $last_status -ne 0 28set status_color( set_color $fish_color_error ) 29set prompt_status$status_color "[" $last_status "]" $normal 30end 31 32echo -s( prompt_login ) ' ' $cwd_color ( prompt_pwd ) $vcs_color ( fish_vcs_prompt ) $normal ' ' $prompt_status 33echo -n -s$status_color $suffix ' ' $normal 34end