antidote / oh-my-zsh: improve escaping of shell arguments#9042
antidote / oh-my-zsh: improve escaping of shell arguments#9042khaneliman merged 2 commits intonix-community:masterfrom
Conversation
a778030 to
ab39652
Compare
khaneliman
left a comment
There was a problem hiding this comment.
Some of these don't look like the placement is correct. It appears it would create escaped strings in the middle of stuff. Would be nice to have some tests around some of the generated values.
Do you mean stuff like Or do you mean something else? |
|
Yeah, just feels wrong to not escape the full path / variable and only part of it. |
|
I'm inclined to say that it looks fine to me and maybe it should be considered idiomatic since it simplifies the code a bit. |
|
This change breaks oh-my-zsh plugins. For example, this was previously working, but now breaks for me: With the following: |
|
@ellingtonjp Oh, sorry. Thanks for giving the error message, I tracked the issue down & will immediately create a 2nd PR |
escapeShellArg single-quotes values, which prevents shell variable expansion. Setting custom = "$HOME/.config/shell" generates ZSH_CUSTOM='$HOME/.config/shell' instead of the expected ZSH_CUSTOM="$HOME/.config/shell", breaking custom themes and plugins. Use double-quoted assignments instead. This allows $HOME and other shell variables to expand while still handling paths with spaces. Regression introduced in PR nix-community#9042.
|
This change also stopped env vars like |
Description
This pull request improves the handling of shell arguments in the Antidote and Oh My Zsh Home Manager modules by ensuring all relevant file paths and arguments are properly shell-escaped.
Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.