fix(zsh): restore PATH entries orphaned by ZDOTDIR - #9
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR restores PATH entries that were previously being appended to ~/.zprofile (but no longer sourced due to ZDOTDIR being set in .zshenv) by moving the relevant PATH setup into .zshenv, ensuring both interactive and non-interactive zsh invocations can find those tools.
Changes:
- Append OrbStack binaries to
pathsodocker,kubectl, andorbare available again. - Append JetBrains Toolbox
scriptsdirectory topathso Toolbox-managed scripts are on PATH again. - Add OrbStack zsh completions directory to
fpath.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # OrbStack's completions. Its init.zsh sets only this and the PATH line above, | ||
| # so sourcing the file itself would add nothing. | ||
| fpath+=($HOME/.orbstack/shell/completions/zsh(N-/)) |
There was a problem hiding this comment.
Keeping this in .zshenv on purpose. The file's "environment setup only" rule is about no output, no prompts, nothing slow; a plain fpath+= array append is none of those. Moving just the completions line to .zshrc would split OrbStack's setup across two files to spare non-interactive shells a single array entry, which isn't worth it. Added a comment in the code noting the deliberate exception.
b6f6042 to
18d82bb
Compare
374b7b0 to
0a6a025
Compare
|
Reworked onto the current The original premise was partly stale and the comment in the file has been corrected. When this was written, it claimed docker, orb and kubectl had fallen off PATH. They had not, or at least no longer have: OrbStack's installer also symlinks Measured it rather than assuming, by diffing a rendered
So what this actually recovers is the JetBrains Toolbox scripts, which resolve nowhere else, plus OrbStack's zsh completions, which nothing else provides. The OrbStack path entry is kept regardless, so this does not depend on symlinks written outside chezmoi's control, and The underlying ZDOTDIR point still stands: |
18d82bb to
c4e44b9
Compare
The OrbStack and JetBrains Toolbox installers each appended their PATH setup to ~/.zprofile. But .zshenv sets ZDOTDIR to ~/.config/zsh, and zsh then reads .zprofile, .zshrc and .zlogin from $ZDOTDIR only, never $HOME, not even for login shells. That file has been dead ever since, and still is: 11 lines, none of them read. Scope is narrower than it first looks, and the comment in the file now says so. The Toolbox scripts (goland, datagrip, rider) resolve nowhere else and were genuinely unreachable. OrbStack's binaries were not: its installer also symlinks docker, kubectl, orb and orbctl into /usr/local/bin, so those kept working by another route. Its zsh completions had no other source either. The OrbStack path entry is kept anyway so this does not rely on symlinks written outside chezmoi's control, and (N-/) costs nothing when the directory is absent. Appended rather than prepended, matching the installers, which also keeps Homebrew's versioned kubectl ahead of the copy OrbStack bundles. Verified against a rendered template in an `env -i` shell, diffed with and without this change: goland, datagrip and rider go from unresolvable to resolvable, the OrbStack completions land on fpath, and no existing entry changes position.
c4e44b9 to
4d1b784
Compare

The OrbStack and JetBrains Toolbox installers each appended their PATH
setup to ~/.zprofile. But .zshenv sets ZDOTDIR to ~/.config/zsh, and zsh
then reads .zprofile/.zshrc/.zlogin from $ZDOTDIR only, never $HOME, not
even for login shells. So ~/.zprofile has been dead for a long time and
docker, orb, kubectl and the Toolbox scripts silently fell off PATH.
Add them to .zshenv (appended, matching what the installers intended) plus
OrbStack's zsh completions on fpath. Verified from a clean
env -ishell.