mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
zsh: escape cdpath entries
Zsh cdpath is an array. Rendering entries by joining on spaces breaks paths containing spaces, glob characters, or other shell syntax. Use the shared shell array formatter so each configured cdpath entry is emitted as a quoted array element.
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
||||
cdpath = [
|
||||
"$HOME/projects"
|
||||
"/tmp/with space"
|
||||
"/tmp/with[glob]"
|
||||
];
|
||||
|
||||
initContent = lib.mkMerge [
|
||||
(lib.mkBefore ''
|
||||
# High priority (mkBefore)
|
||||
@@ -34,6 +40,8 @@
|
||||
echo "High priority content"
|
||||
|
||||
typeset -U path cdpath fpath manpath
|
||||
cdpath+=("$HOME/projects" "/tmp/with space" "/tmp/with[glob]")
|
||||
|
||||
for profile in ''${(z)NIX_PROFILES}; do
|
||||
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user