Repository navigation
fix(host-tools): put Homebrew and mise on PATH for a non-interactive bash - #191
Merged
Merged
Conversation
…bash A command run over SSH starts a non-interactive bash, which returns from ~/.bashrc at the interactive guard of Debian and Ubuntu's default file. Homebrew's shellenv and mise's activation are written below it, and mise's activation is a prompt hook, so on those hosts brew, mise and mise's tools were not found over SSH. A bash host now gets a block named path at the top of ~/.bashrc, written like the environment variables, that puts mise's shim directory ahead of Homebrew's bin and sbin on PATH. That is the form mise documents for programs that never see an activated shell, and it starts no process and prints nothing, which a startup file must not do for scp and sftp. Only the tools that are wanted are named. A PATH assignment that already names the prefix's bin in a startup file counts as the equivalent, and a block an earlier run wrote follows a changed prefix or a tool switched off in place. The interactive lines stay where they are. The tests drive the role against Ubuntu's default bashrc and look the commands up with a real non-interactive bash, before and after.
Mearman
marked this pull request as ready for review
November 3, 2026 13:30
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
🎉 This PR is included in version 2.26.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
On the Ubuntu hosts
ssh <host> 'command -v brew mise'prints nothing and the PATH is the system default. The role writeseval "$(brew shellenv)"and the mise activation below the interactive guard of~/.bashrc, which a non-interactive bash (what sshd starts for a command) never reaches, andmise activateis a prompt hook anyway.A bash host now gets a
pathblock at the top of~/.bashrc, placed like the env variables from #187:That is the form mise documents for programs that never see an activated shell (Shims, archived); it spawns nothing and prints nothing, so scp and sftp are not affected. Homebrew's bin holds
brewand the brew-installedmise. Only the wanted tools are named. A PATH assignment already naming the prefix's bin counts as the equivalent, and the interactive lines stay where they are. zsh is unchanged (~/.zshenvis read in full).Tests run the role against Ubuntu's default bashrc and look
node,brewandmiseup with a real non-interactive bash, before (not found) and after. I also ran the role against copies of the real asus and i5~/.bashrc: same result, one block, nothing duplicated, second run unchanged.