mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
zsh: escape double-quoted values
The zsh value renderer emits strings in double quotes so session variables can still expand references such as $HOME. Embedded quotes, backslashes, and backticks were not escaped, which could corrupt generated zsh code or trigger command substitution. Escape those double-quote-sensitive characters while preserving dollar expansion for existing session-variable semantics.
This commit is contained in:
@@ -14,6 +14,11 @@
|
||||
home = "$HOME/Documents";
|
||||
quoted = ''/tmp/with "quotes"'';
|
||||
};
|
||||
localVariables = {
|
||||
BACKTICK = "`literal`";
|
||||
QUOTED = ''value "quoted"'';
|
||||
RUNTIME = "$HOME/bin";
|
||||
};
|
||||
|
||||
initContent = lib.mkMerge [
|
||||
(lib.mkBefore ''
|
||||
@@ -54,6 +59,9 @@
|
||||
|
||||
HELPDIR="@zsh@/share/zsh/$ZSH_VERSION/help"
|
||||
|
||||
BACKTICK="\`literal\`"
|
||||
QUOTED="value \"quoted\""
|
||||
RUNTIME="$HOME/bin"
|
||||
autoload -U compinit && compinit
|
||||
# History options should be set in .zshrc and after oh-my-zsh sourcing.
|
||||
# See https://github.com/nix-community/home-manager/issues/177.
|
||||
|
||||
Reference in New Issue
Block a user