fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
cbc3cd21f
master
1# name: Informative 2# http://michal.karzynski.pl/blog/2009/11/19/my-informative-shell-prompt/ 3 4function fish_prompt --description'Informative prompt' 5#Save the return status of the previous command 6set -l last_pipestatus$pipestatus 7set -lx __fish_last_status$status # Export for __fish_print_pipestatus. 8 9if functions -q fish_is_root_user;and fish_is_root_user 10printf '%s@%s %s%s%s# ' $USER ( prompt_hostname ) ( set -q fish_color_cwd_root 11and set_color $fish_color_cwd_root 12or set_color $fish_color_cwd ) \ 13( prompt_pwd ) ( set_color --reset) 14else 15set -l status_color( set_color $fish_color_status ) 16set -l statusb_color( set_color --bold$fish_color_status ) 17set -l pipestatus_string( __fish_print_pipestatus "[" "]" "|" " $status_color " " $statusb_color " $last_pipestatus ) 18 19printf '[%s] %s%s@%s %s%s %s%s%s \n> ' ( date "+%H:%M:%S" ) ( set_color brblue) \ 20$USER ( prompt_hostname ) ( set_color $fish_color_cwd ) ( prompt_pwd ) $pipestatus_string \ 21( set_color --reset) 22end 23end