mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Support for defining color with bold/brighter color set
This commit is contained in:
parent
4702283280
commit
a142c5e1ec
@ -493,13 +493,24 @@ end
|
|||||||
|
|
||||||
function __fish_git_prompt_set_color
|
function __fish_git_prompt_set_color
|
||||||
set -l user_variable_name "$argv[1]"
|
set -l user_variable_name "$argv[1]"
|
||||||
|
set -l user_variable $$user_variable_name
|
||||||
|
set -l user_variable_bright
|
||||||
|
|
||||||
|
if test (count $user_variable) -eq 2
|
||||||
|
set user_variable_bright $user_variable[2]
|
||||||
|
set user_variable $user_variable[1]
|
||||||
|
end
|
||||||
|
|
||||||
set -l variable _$user_variable_name
|
set -l variable _$user_variable_name
|
||||||
set -l variable_done "$variable"_done
|
set -l variable_done "$variable"_done
|
||||||
set -l user_variable $$user_variable_name
|
|
||||||
|
|
||||||
if not set -q $variable
|
if not set -q $variable
|
||||||
if test -n "$user_variable"
|
if test -n "$user_variable"
|
||||||
set -g $variable (set_color $user_variable)
|
if test -n "$user_variable_bright"
|
||||||
|
set -g $variable (set_color -o $user_variable)
|
||||||
|
else
|
||||||
|
set -g $variable (set_color $user_variable)
|
||||||
|
end
|
||||||
set -g $variable_done (set_color normal)
|
set -g $variable_done (set_color normal)
|
||||||
else
|
else
|
||||||
set -g $variable ''
|
set -g $variable ''
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
set -g __fish_git_prompt_show_status 1
|
set -g __fish_git_prompt_show_status 1
|
||||||
set -g __fish_git_prompt_hide_untrackedfiles 1
|
set -g __fish_git_prompt_hide_untrackedfiles 1
|
||||||
|
|
||||||
set -g __fish_git_prompt_color_branch magenta
|
set -g __fish_git_prompt_color_branch magenta bold
|
||||||
set -g __fish_git_prompt_showupstream "informative"
|
set -g __fish_git_prompt_showupstream "informative"
|
||||||
set -g __fish_git_prompt_char_upstream_ahead "↑"
|
set -g __fish_git_prompt_char_upstream_ahead "↑"
|
||||||
set -g __fish_git_prompt_char_upstream_behind "↓"
|
set -g __fish_git_prompt_char_upstream_behind "↓"
|
||||||
@ -20,7 +20,7 @@ set -g __fish_git_prompt_color_dirtystate blue
|
|||||||
set -g __fish_git_prompt_color_stagedstate yellow
|
set -g __fish_git_prompt_color_stagedstate yellow
|
||||||
set -g __fish_git_prompt_color_invalidstate red
|
set -g __fish_git_prompt_color_invalidstate red
|
||||||
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
|
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
|
||||||
set -g __fish_git_prompt_color_cleanstate green
|
set -g __fish_git_prompt_color_cleanstate green bold
|
||||||
|
|
||||||
|
|
||||||
function fish_prompt --description 'Write out the prompt'
|
function fish_prompt --description 'Write out the prompt'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user