mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
prompt: don't set default colors twice
The colors are set in __fish_config_interactive before the prompt is painted for the first time. Also initialize the $fish_color_status for the (pipe) status, bump the version for that. [ci skip]
This commit is contained in:
parent
3f10da0d01
commit
2f1a5e65d8
6 changed files with 4 additions and 23 deletions
|
@ -44,9 +44,7 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
|
|
||||||
#
|
#
|
||||||
# If we are starting up for the first time, set various defaults.
|
# If we are starting up for the first time, set various defaults.
|
||||||
#
|
if not set -q __fish_init_3_1_0
|
||||||
# bump this to 2_4_0 when rolling release if anything changes after 9/10/2016
|
|
||||||
if not set -q __fish_init_2_39_8
|
|
||||||
|
|
||||||
# Regular syntax highlighting colors
|
# Regular syntax highlighting colors
|
||||||
__init_uvar fish_color_normal normal
|
__init_uvar fish_color_normal normal
|
||||||
|
@ -61,9 +59,9 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
__init_uvar fish_color_quote 999900
|
__init_uvar fish_color_quote 999900
|
||||||
__init_uvar fish_color_autosuggestion 555 brblack
|
__init_uvar fish_color_autosuggestion 555 brblack
|
||||||
__init_uvar fish_color_user brgreen
|
__init_uvar fish_color_user brgreen
|
||||||
|
|
||||||
__init_uvar fish_color_host normal
|
__init_uvar fish_color_host normal
|
||||||
__init_uvar fish_color_valid_path --underline
|
__init_uvar fish_color_valid_path --underline
|
||||||
|
__init_uvar fish_color_status red
|
||||||
|
|
||||||
__init_uvar fish_color_cwd green
|
__init_uvar fish_color_cwd green
|
||||||
__init_uvar fish_color_cwd_root red
|
__init_uvar fish_color_cwd_root red
|
||||||
|
@ -92,7 +90,8 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
#
|
#
|
||||||
__init_uvar fish_color_history_current --bold
|
__init_uvar fish_color_history_current --bold
|
||||||
|
|
||||||
set -U __fish_init_2_39_8
|
set -e __fish_init_2_39_8
|
||||||
|
set -U __fish_init_3_1_0
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -5,13 +5,8 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -l last_pipestatus $pipestatus
|
set -l last_pipestatus $pipestatus
|
||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
# Initialize our variables.
|
|
||||||
set -q fish_color_user
|
|
||||||
or set -U fish_color_user -o green
|
|
||||||
set -q fish_color_host
|
set -q fish_color_host
|
||||||
or set -U fish_color_host -o cyan
|
or set -U fish_color_host -o cyan
|
||||||
set -q fish_color_status
|
|
||||||
or set -U fish_color_status red
|
|
||||||
|
|
||||||
# Color the prompt differently when we're root
|
# Color the prompt differently when we're root
|
||||||
set -l color_cwd $fish_color_cwd
|
set -l color_cwd $fish_color_cwd
|
||||||
|
|
|
@ -5,9 +5,6 @@ function fish_prompt --description "Write out the prompt"
|
||||||
# Save our status
|
# Save our status
|
||||||
set -l last_pipestatus $pipestatus
|
set -l last_pipestatus $pipestatus
|
||||||
|
|
||||||
set -q fish_color_status
|
|
||||||
or set -U fish_color_status red
|
|
||||||
|
|
||||||
set -l color_cwd
|
set -l color_cwd
|
||||||
set -l suffix
|
set -l suffix
|
||||||
switch "$USER"
|
switch "$USER"
|
||||||
|
|
|
@ -7,12 +7,8 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
# Initialize our variables.
|
# Initialize our variables.
|
||||||
set -q fish_color_user
|
|
||||||
or set -U fish_color_user -o green
|
|
||||||
set -q fish_color_host
|
set -q fish_color_host
|
||||||
or set -U fish_color_host -o cyan
|
or set -U fish_color_host -o cyan
|
||||||
set -q fish_color_status
|
|
||||||
or set -U fish_color_status red
|
|
||||||
|
|
||||||
# Color the prompt differently when we're root
|
# Color the prompt differently when we're root
|
||||||
set -l color_cwd $fish_color_cwd
|
set -l color_cwd $fish_color_cwd
|
||||||
|
|
|
@ -5,9 +5,6 @@ function fish_prompt --description 'Informative prompt'
|
||||||
#Save the return status of the previous command
|
#Save the return status of the previous command
|
||||||
set -l last_pipestatus $pipestatus
|
set -l last_pipestatus $pipestatus
|
||||||
|
|
||||||
set -q fish_color_status
|
|
||||||
or set -U fish_color_status red
|
|
||||||
|
|
||||||
switch "$USER"
|
switch "$USER"
|
||||||
case root toor
|
case root toor
|
||||||
printf '%s@%s %s%s%s# ' $USER (prompt_hostname) (set -q fish_color_cwd_root
|
printf '%s@%s %s%s%s# ' $USER (prompt_hostname) (set -q fish_color_cwd_root
|
||||||
|
|
|
@ -56,9 +56,6 @@ function fish_prompt --description 'Write out the prompt'
|
||||||
set -g __fish_git_prompt_color_cleanstate green --bold
|
set -g __fish_git_prompt_color_cleanstate green --bold
|
||||||
end
|
end
|
||||||
|
|
||||||
set -q fish_color_status
|
|
||||||
or set -U fish_color_status red
|
|
||||||
|
|
||||||
set -l color_cwd
|
set -l color_cwd
|
||||||
set -l prefix
|
set -l prefix
|
||||||
set -l suffix
|
set -l suffix
|
||||||
|
|
Loading…
Reference in a new issue