mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
fish_config: Write an empty prompt if necessary
This clears the right prompt if the new preset doesn't have any. This was supposed to be fixed but was broken again in f3b950157de40b07afb6fd14946e20b98c9b5e26. Fixes #10675.
This commit is contained in:
parent
ad674c61dc
commit
c9bc04f274
@ -118,12 +118,18 @@ function fish_config --description "Launch fish's web based configuration"
|
||||
# or we'd throw an error on a stock fish.
|
||||
path is $__fish_config_dir/functions/fish_prompt.fish
|
||||
and cp $__fish_config_dir/functions/fish_prompt.fish{,.bak}
|
||||
path is $__fish_config_dir/functions/fish_right_prompt.fish
|
||||
and cp $__fish_config_dir/functions/fish_right_prompt.fish{,.bak}
|
||||
|
||||
set -l have
|
||||
if set -q argv[1]
|
||||
for f in $prompt_dir/$argv[1].fish
|
||||
if 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
|
||||
source $f
|
||||
or return 2
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user