2023-02-05 22:13:01 +02:00
|
|
|
function prompt.add
|
2023-02-23 20:52:50 +02:00
|
|
|
set -l color $argv[1]
|
|
|
|
set -l text $argv[2]
|
|
|
|
set -l sep ''
|
|
|
|
if test -n "$prompt_sep"
|
|
|
|
set sep (set_color $prev_color)$prompt_sep(set_color $color_fg)
|
|
|
|
set prev_color $color
|
|
|
|
end
|
2023-02-05 22:13:01 +02:00
|
|
|
if test -z "$prompt_string"
|
|
|
|
set prompt_string (set_color -b $color)(set_color $color_fg) $text
|
|
|
|
else
|
2023-02-23 20:52:50 +02:00
|
|
|
set -a prompt_string (set_color -b $color)$sep $text
|
2023-02-05 22:13:01 +02:00
|
|
|
end
|
|
|
|
end
|