mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 03:21:16 -03:00
fish_config theme save: reset prompts in standalone builds too
This commit is contained in:
@@ -161,17 +161,13 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
set -l f $prompt_dir/$argv[1].fish
|
||||
if set -q f[1] && test -f $f
|
||||
set have $f
|
||||
# Set the functions to empty so we empty the file
|
||||
# if necessary.
|
||||
function fish_prompt
|
||||
end
|
||||
function fish_right_prompt
|
||||
end
|
||||
__fish_config_prompt_save
|
||||
source $f
|
||||
or return 2
|
||||
end
|
||||
if not set -q have[1]
|
||||
if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null
|
||||
__fish_config_prompt_save
|
||||
status get-file tools/web_config/sample_prompts/$argv[1].fish | source
|
||||
else
|
||||
echo "No such prompt: '$argv[1]'" >&2
|
||||
@@ -397,3 +393,12 @@ function __fish_config_prompt_choose
|
||||
functions --erase fish_right_prompt
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_config_prompt_save
|
||||
# Set the functions to empty so we empty the file
|
||||
# if necessary.
|
||||
function fish_prompt
|
||||
end
|
||||
function fish_right_prompt
|
||||
end
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ grep '\S' $__fish_config_dir/functions/{fish_prompt,fish_right_prompt,fish_mode_
|
||||
echo yes | fish_config prompt save nim >/dev/null
|
||||
grep -q nim@Hattori $__fish_config_dir/functions/fish_prompt.fish ||
|
||||
echo 'failed to save prompt?'
|
||||
grep -E 'function|end' $__fish_config_dir/functions/fish_right_prompt.fish
|
||||
cat $__fish_config_dir/functions/fish_right_prompt.fish
|
||||
# CHECK: function fish_right_prompt
|
||||
# CHECK: end
|
||||
cat $__fish_config_dir/functions/fish_mode_prompt.fish
|
||||
|
||||
Reference in New Issue
Block a user