zsh: improve shell{,Global}Aliases

This commit changes the way aliases are rendered, adding the "no more
flags" flag `--`, which means that, for example, the alias `"-" = "cd
-";` will work as expected. (I was getting a syntax error before this
change.)

Additionally, now the alias key is shell escaped, which may help some
edge cases. I'm honestly not sure if this part is necessary since I
assume an alias can't contain spaces anyway, but it definitely
shouldn't break anything.
This commit is contained in:
bri 2024-02-22 11:55:26 -05:00 committed by Robert Helgesson
parent ad9254cd9a
commit cf111d1a84
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
2 changed files with 5 additions and 5 deletions

View file

@ -23,10 +23,10 @@ with lib;
assertFileExists home-files/.zshrc
assertFileContains \
home-files/.zshrc \
"alias ls='@pls@/bin/pls'"
"alias -- 'ls'='@pls@/bin/pls'"
assertFileContains \
home-files/.zshrc \
"alias ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'"
"alias -- 'll'='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'"
'';
};
}