2023-02-05 22:13:01 +02:00
|
|
|
function prompt.add
|
2023-08-21 20:58:02 +03:00
|
|
|
set -l text $argv[1]
|
|
|
|
set -l color $argv[2]
|
|
|
|
if test -n "$color"
|
|
|
|
set value (set_color $color)$text(set_color normal)
|
|
|
|
else
|
|
|
|
set value $text
|
2023-02-23 20:52:50 +02:00
|
|
|
end
|
2023-02-05 22:13:01 +02:00
|
|
|
if test -z "$prompt_string"
|
2023-08-21 20:58:02 +03:00
|
|
|
set prompt_string $value
|
2023-02-05 22:13:01 +02:00
|
|
|
else
|
2023-08-21 20:58:02 +03:00
|
|
|
set -a prompt_string $value
|
2023-02-05 22:13:01 +02:00
|
|
|
end
|
|
|
|
end
|