fix(terminal): restore full PATH and consistent shell init for PTY sessions#268
Open
dtger wants to merge 2 commits intocoollabsio:mainfrom
Open
fix(terminal): restore full PATH and consistent shell init for PTY sessions#268dtger wants to merge 2 commits intocoollabsio:mainfrom
dtger wants to merge 2 commits intocoollabsio:mainfrom
Conversation
macOS GUI apps inherit a minimal PATH, so terminal sessions were missing binaries from Homebrew, cargo, etc. Call ensure_macos_path() before PTY spawn and use -l flag for interactive shells to source login profiles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
PATH, including tools installed via Homebrew, bun, nvm, and similar setups-lcfor more consistent environment initializationcommand_argsunchanged while reducing cases where commands work in an opened terminal but fail in a PTY-launched commandProblem
macOS GUI apps launched outside a terminal can inherit a minimal
PATH, which caused PTY sessions to miss user-installed binaries. interactive PTY shells using login-shell behavior should also be aligned with shell-wrapped PTY commands.Approach
ensure_macos_path()before spawning PTY processes so terminal sessions inherit the corrected process environment-lfor interactive Unix PTY shells-lcfor Unix shell-wrapped PTY commands to align command execution with interactive terminal environment setupNotes
PATHon macOS, matching expected terminal behaviorcommand_argsremains the preferred path when exact argument handling is needed