fish: escape abbr expansions once again

Commit 8cedd6 `fish: support flexible abbreviations` removed shell
escaping for fish shell abbr values. This was a dangerous breaking
change offered little value and made writing abbr expansions more
difficult. This commit restores automatic shell escaping of fish abbr
values.
This commit is contained in:
Stel Abrego 2023-12-21 00:10:04 -08:00 committed by Robert Helgesson
parent b897544a79
commit 8b797c8eea
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 20 additions and 9 deletions

View file

@ -207,7 +207,8 @@ let
modifiers = if isAttrs def then mods else "";
expansion = if isAttrs def then def.expansion else def;
in "abbr --add ${modifiers} -- ${name}"
+ optionalString (expansion != null) " \"${expansion}\"") cfg.shellAbbrs);
+ optionalString (expansion != null) " ${escapeShellArg expansion}")
cfg.shellAbbrs);
aliasesStr = concatStringsSep "\n"
(mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases);