zsh: keep each PATH directory once

Every nested shell, and every sourced file that prepends, added the same
directories again; a workstation's PATH carried each of several entries three
times. typeset -U in the .zshenv block applies to every zsh.
This commit is contained in:
jochen
2026-10-04 11:34:36 +02:00
parent ca5ab288f6
commit 328d90fb88
+1 -1
View File
@@ -51,7 +51,7 @@
"mode": "0644",
"into": "block",
"at": "start",
"content": "# The mesh's block (module zsh, novox/hq ADR 0203, ADR 0204): the account's environment, read by\n# every zsh — a login, a script, and node-login-shell's execute. Replaced at every push; everything\n# outside it is yours.\nif [[ -r \"${machine:account-home}/.config/mesh/environment.sh\" ]]; then\n source \"${machine:account-home}/.config/mesh/environment.sh\"\nfi\n"
"content": "# The mesh's block (module zsh, novox/hq ADR 0203, ADR 0204): the account's environment, read by\n# every zsh — a login, a script, and node-login-shell's execute. Replaced at every push; everything\n# outside it is yours.\n# PATH keeps each directory once, wherever it was added: the session, a nested shell or a\n# sourced file. Without it every nested shell prepended the same entries again.\ntypeset -U path PATH\nif [[ -r \"${machine:account-home}/.config/mesh/environment.sh\" ]]; then\n source \"${machine:account-home}/.config/mesh/environment.sh\"\nfi\n"
},
{
"id": "rc",