Problem
The mkAbbrStr function unconditionally concatenates "${abbr.expansion}" at the end of the generated command:
mkAbbrStr = abbr:
(foldl' (
acc: elem: acc + " " + (mkAbbrArg elem abbr)
) "abbr --add ${abbr.word} ${mkCursorArg abbr}" abbrArgs)
+ " "
+ "\"${abbr.expansion}\"";
This causes two related problems:
Empty string bug: When expansion = "", fish receives a trailing empty argument:
abbr --add dot-dot --regex "^\.\.+\$" ""
--function incompatibility: Fish abbr --function does not require an expansion at all. However, because expansion is declared as types.str with no default, users must pass expansion = "" to satisfy the module, which then generates the invalid trailing "".
Reproduction:
{
abbreviations.myabbr = {
word = "myabbr";
function = "my_function";
expansion = ""; # forced to satisfy types.str, but meaningless to fish
};
}
Problem
The
mkAbbrStrfunction unconditionally concatenates"${abbr.expansion}"at the end of the generated command:This causes two related problems:
Empty string bug: Whenexpansion = "", fish receives a trailing empty argument:--function incompatibility: Fish abbr--functiondoes not require an expansion at all. However, because expansion is declared as types.str with no default, users must passexpansion = ""to satisfy the module, which then generates the invalid trailing"".Reproduction: