summaryrefslogtreecommitdiff
path: root/config/zshenv
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
committerIgor Soarez <igor@soarez.org>2026-09-17 19:45:23 +0100
commit13cc065ec014b86369dfe4ad60d1a43fa06fd251 (patch)
tree684690c61b7b59758c2aac132c65b81c86de0608 /config/zshenv
dotfiles
Shell, editor and terminal configuration, the tools that go with them, and szecret, an age-based secret manager whose store lives elsewhere. History restarts here. What came before was not written to be read by anyone else, and carried machine names, addresses and an encrypted secret store; it is kept privately instead. What is left is meant to be safe on any machine, including one whose owner is not me: see CLAUDE.md for the rule it is written to.
Diffstat (limited to 'config/zshenv')
-rw-r--r--config/zshenv23
1 files changed, 23 insertions, 0 deletions
diff --git a/config/zshenv b/config/zshenv
new file mode 100644
index 0000000..53580a7
--- /dev/null
+++ b/config/zshenv
@@ -0,0 +1,23 @@
+# ~/.zshenv — read by *every* zsh, including non-interactive, non-login ones.
+#
+# For `ssh <host> <command>`, `zsh -c ...` and plain scripts this is the *only*
+# startup file zsh reads: ~/.zprofile and ~/.zshrc are both skipped, and on
+# macOS so is /etc/zprofile, which is what runs path_helper. Without this file
+# such shells start with the bare system PATH (/usr/bin:/bin:/usr/sbin:/sbin).
+#
+# That broke `mosh <macos-host>`: mosh launches mosh-server over ssh as a
+# non-interactive command, and Homebrew's /opt/homebrew/bin was not on PATH, so
+# it died with "command not found: mosh-server". Linux hosts happened to work
+# only because mosh-server lives in /usr/bin there.
+#
+# Keep this file a thin shim. The actual environment lives in config/env, which
+# is POSIX sh so bash can share it. Interactive-only setup (aliases, history,
+# theme, profile.d, jenv) belongs in config/profile, sourced from ~/.zshrc.
+
+# Keep $path/$PATH free of duplicates for the life of this shell. zsh-only, so
+# it lives here rather than in the POSIX config/env.
+typeset -U path PATH
+
+[ -r "$HOME/.env" ] && . "$HOME/.env"
+
+# vim: filetype=zsh