From b96c92a7f7b8ed2e46cc51c2cdb8057a905ed84e Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 8 Nov 2021 17:47:20 +0100 Subject: [PATCH] fish_config: Erase global theme variables if saving --- share/functions/fish_config.fish | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index 6aa766fe1..65a4e7c37 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -245,10 +245,11 @@ function fish_config --description "Launch fish's web based configuration" string match -rq '^fish_(?:pager_)?color.*$' -- $toks[1] or continue - # Note: This can warn about global variables shadowing the universal - # versions we create. - # We want that warning to go through, because we *can't* - # permanently remove the globals. + # If we're supposed to set universally, remove any shadowing globals, + # so the change takes effect immediately (and there's no warning). + if test x"$scope" = x-U; and set -qg $toks[1] + set -eg $toks[1] + end set $scope $toks set have_color 1 end <$file