mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-31 17:07:27 +08:00
add $pipestatus
to classic_vcs.fish prompt
This commit is contained in:
parent
0923712e3e
commit
da2925bad7
@ -3,6 +3,7 @@
|
||||
# vim: set noet:
|
||||
|
||||
function fish_prompt --description 'Write out the prompt'
|
||||
set -l last_pipestatus $pipestatus
|
||||
set -l last_status $status
|
||||
set -l normal (set_color normal)
|
||||
|
||||
@ -62,9 +63,9 @@ function fish_prompt --description 'Write out the prompt'
|
||||
set suffix '>'
|
||||
end
|
||||
|
||||
set -l prompt_status
|
||||
set -l prompt_status (__fish_print_pipestatus "[" "] " "|" (set_color yellow) (set_color --bold yellow) $last_pipestatus)
|
||||
if test $last_status -ne 0
|
||||
set prompt_status ' ' (set_color $fish_color_status) "[$last_status]" "$normal"
|
||||
set prompt_status " $prompt_status" (set_color $fish_color_status) "[$last_status]" "$normal"
|
||||
end
|
||||
|
||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $fish_color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal $prompt_status $suffix " "
|
||||
|
Loading…
x
Reference in New Issue
Block a user