Repository navigation
Give SSH commands the user-level tool paths - #6632
Merged
Merged
Conversation
ssh host cmd runs neither a login nor an interactive shell, so on Arch it
gets the bare sshd PATH and can't find mise-managed tools like the agent
CLIs herdr scans for. Set PATH in the PAM environment (per-user via
@{HOME}), append the user-level dirs in env-bootstrap so login shells and
the uwsm session get them too, and source env-bootstrap before bashrc's
interactive guard for bash variants that read it non-interactively.
Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends user-level tool paths to SSH commands, login shells, and Omarchy sessions.
Changes:
- Configures PAM paths for fresh and existing installations.
- Extends and tests the shared environment bootstrap.
- Sources the bootstrap for non-interactive Bash sessions.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/shell.d/dev-env-path-test.sh |
Tests path appending and deduplication. |
migrations/1786181929.sh |
Adds PAM paths to existing systems. |
install/config/ssh-command-path.sh |
Configures PAM paths during installation. |
install/config/all.sh |
Runs the new installation step. |
default/bashrc |
Bootstraps non-interactive shells. |
default/bash/env-bootstrap |
Appends user-level executable paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Appending with a bare "$PATH:" prefix leaves a leading colon when PATH is unset, which shells treat as the current directory. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Suppressed comments (1)
migrations/1786181929.sh:9
- The added shell coverage only exercises
env-bootstrap; this system-wide migration (and its fresh-install counterpart) is never run against a fixture. Because the skip-if-managed behavior and exact PAM syntax are the core of the change, add a configurable pam_env target and a shell test covering an absent file, an existingPATHentry, and a second idempotent run, following the migration-test pattern used elsewhere intest/shell.d/.
grep -qE '^PATH[[:space:]]' /etc/security/pam_env.conf && exit 0
sudo tee -a /etc/security/pam_env.conf >/dev/null <<'EOF'
nick1udwig
pushed a commit
to nick1udwig/omarchy
that referenced
this pull request
Sep 9, 2026
* Give SSH commands the user-level tool paths
ssh host cmd runs neither a login nor an interactive shell, so on Arch it
gets the bare sshd PATH and can't find mise-managed tools like the agent
CLIs herdr scans for. Set PATH in the PAM environment (per-user via
@{HOME}), append the user-level dirs in env-bootstrap so login shells and
the uwsm session get them too, and source env-bootstrap before bashrc's
interactive guard for bash variants that read it non-interactively.
Co-Authored-By: Claude Fable 5 <[email protected]>
* Don't let an empty PATH turn into a cwd entry
Appending with a bare "$PATH:" prefix leaves a leading colon when PATH
is unset, which shells treat as the current directory.
Co-Authored-By: Claude Fable 5 <[email protected]>
---------
Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
herdr --remotebridges withssh -T, so the remote server starts from a non-login, non-interactive shell. On Arch nothing user-configurable runs in that context — no/etc/profile, and bash isn't compiled with Debian'sSSH_SOURCE_BASHRCpatch — so the server sees the bare sshd PATH and can't find any mise-managed agent CLIs (claude,codex, …). The same failure hits anyssh host cmdremoting convention.Three layers, outermost first:
install/config/ssh-command-path.sh(wired intoinstall/config/all.sh) appends aPATH DEFAULT=...:@{HOME}/.local/share/mise/shims:@{HOME}/.local/binline to/etc/security/pam_env.conf.pam_env.sosits in sshd's session stack andUsePAM yesis the Arch default, so plain SSH commands now inherit the user-level tool paths, expanded per-user from passwd.migrations/1786181929.shapplies the same line on existing installs. Both skip if aPATHline already exists there.~/.local/bin(after system paths, so nothing shadows/usr/bin), which completes login shells (ssh -t,bash -lc) and the uwsm session. The redundant~/.local/binappend inenvsstays: dev-linked machines source the packaged env-bootstrap from.bashrc, so dropping it would regress them until the package ships..bashrcnon-interactively.Verified:
env -i HOME=... sh -c '. env-bootstrap; command -v claude herdr'resolves both from a bare PATH; pam_env append tested idempotent against a copy;./test/shell(140 files) and./test/clipass, withdev-env-path-test.shextended to cover the appends.🤖 Generated with Claude Code