mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-19 07:42:44 +08:00
Prompts: Don't color space before pipestatus
These passed " [" to __fish_print_pipestatus as the left brace. If the color contained a background, that would also color the space in, leading to a weird unbalanced space before and none after. Instead, prepend the whitespace when printing later. [ci skip]
This commit is contained in:
parent
bc715c6eb4
commit
6a21a2ce16
|
@ -30,7 +30,7 @@ function fish_prompt --description 'Write out the prompt'
|
|||
set bold_flag
|
||||
end
|
||||
set __fish_prompt_status_generation $status_generation
|
||||
set -l prompt_status (__fish_print_pipestatus $last_status " [" "]" "|" (set_color $fish_color_status) (set_color $bold_flag $fish_color_status) $last_pipestatus)
|
||||
set -l prompt_status (__fish_print_pipestatus $last_status "[" "]" "|" (set_color $fish_color_status) (set_color $bold_flag $fish_color_status) $last_pipestatus)
|
||||
|
||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal $prompt_status $suffix " "
|
||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
|
||||
end
|
||||
|
|
|
@ -23,6 +23,6 @@ function fish_prompt --description "Write out the prompt"
|
|||
end
|
||||
|
||||
echo -n -s "$USER" @ (prompt_hostname) ' ' (set_color $color_cwd) (prompt_pwd) \
|
||||
(__fish_print_pipestatus $last_status " [" "]" "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus) \
|
||||
" "(__fish_print_pipestatus $last_status "[" "]" "|" (set_color $fish_color_status) (set_color --bold $fish_color_status) $last_pipestatus) \
|
||||
(set_color normal) "$suffix "
|
||||
end
|
||||
|
|
|
@ -30,7 +30,7 @@ function fish_prompt --description 'Write out the prompt'
|
|||
set bold_flag
|
||||
end
|
||||
set __fish_prompt_status_generation $status_generation
|
||||
set -l prompt_status (__fish_print_pipestatus $last_status " [" "]" "|" (set_color $fish_color_status) (set_color $bold_flag $fish_color_status) $last_pipestatus)
|
||||
set -l prompt_status (__fish_print_pipestatus $last_status "[" "]" "|" (set_color $fish_color_status) (set_color $bold_flag $fish_color_status) $last_pipestatus)
|
||||
|
||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal $prompt_status $suffix " "
|
||||
echo -n -s (set_color $fish_color_user) "$USER" $normal @ (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user