Skip to content

fix(host-tools): put Homebrew and mise on PATH for a non-interactive bash - #191

Merged
Mearman merged 1 commit into
mainfrom
fix/host-tools-noninteractive-path
Nov 3, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/host-tools-noninteractive-path

Conversation

@Mearman

@Mearman Mearman commented Nov 3, 2026

Copy link
Copy Markdown
Member

On the Ubuntu hosts ssh <host> 'command -v brew mise' prints nothing and the PATH is the system default. The role writes eval "$(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, and mise activate is a prompt hook anyway.

A bash host now gets a path block at the top of ~/.bashrc, placed like the env variables from #187:

export PATH="$HOME/.local/share/mise/shims:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"

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 brew and the brew-installed mise. 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 (~/.zshenv is read in full).

Tests run the role against Ubuntu's default bashrc and look node, brew and mise up 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.

…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
Mearman marked this pull request as ready for review November 3, 2026 13:30
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-11-03T13:30:23.831673Z
We couldn’t complete this review. Comment @codex security review to try again.
87d3f8d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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.

@Mearman
Mearman merged commit 7b7aa8e into main Nov 3, 2026
35 of 38 checks passed
@Mearman
Mearman deleted the fix/host-tools-noninteractive-path branch November 3, 2026 13:30
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.26.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant