From a08dabf015081666f50ad1538f85d69e2217585e Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 14 Feb 2020 13:36:44 -0800 Subject: [PATCH] fish: escape abbrs and aliases Some of my aliases have apostrophes in them, so shell-escaping them is a must. --- modules/programs/fish.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 476e9c09e..dd58abcab 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -29,13 +29,12 @@ let }; }); - abbrsStr = concatStringsSep "\n" ( - mapAttrsToList (k: v: "abbr --add --global ${k} '${v}'") cfg.shellAbbrs - ); + abbrsStr = concatStringsSep "\n" + (mapAttrsToList (k: v: "abbr --add --global -- ${k} ${escapeShellArg v}") + cfg.shellAbbrs); - aliasesStr = concatStringsSep "\n" ( - mapAttrsToList (k: v: "alias ${k}='${v}'") cfg.shellAliases - ); + aliasesStr = concatStringsSep "\n" + (mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases); in