mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00: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
f3b950157d
.
Fixes #10675.
This commit is contained in:
parent
ad674c61dc
commit
c9bc04f274
1 changed files with 6 additions and 0 deletions
|
@ -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…
Reference in a new issue