Strip login-shell startup noise via marker - #184
Merged
Merged
Conversation
Wrap every brew invocation in the user's login+interactive shell (-l -i) for environment parity with Terminal, then print a unique marker to stdout/stderr right before execing brew and strip everything up through that marker line — so rc-file startup noise (banners, OSC sequences) never leaks into the command's real output.
MikeMcQuaid
approved these changes
Sep 14, 2026
Collaborator
Author
|
Fixes #167 |
|
Hello, |
It's available and I confirm that it works now |
This comment was marked as low quality.
This comment was marked as low quality.
Member
|
There will be a near infinite number of possible shell variants that break this app. Anything that isn't reported by multiple people will not be prioritised. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #167
Closes #157
PR: Strip login shell startup noise from brew output
Summary
LoginShellBrewCommandRunnerwraps every brew invocation in the user's login and interactive shell (-l -i) for parity with Terminal. Some shell configurations, notably iTerm2's shell integration, print banners or OSC escape sequences to stdout and stderr during startup, and that noise was leaking into brew's output and breaking JSON parsing and error display. This PR adds a marker based cutoff so only the real command output survives.Changes
LoginShellBrewCommandRunnerprints a unique marker to the output streams right before exec'ing brew, then strips everything up to and including that marker line from the buffered result.LoginShellStartupGatefilters live lines the same way, so the marker line and everything before it never reach the line observer.Testing
LoginShellBrewCommandRunnerTests, in particular:run strips shell startup noise from both streams, which reproduces the iTerm2 shell integration report: startup noise on both streams ahead of the real command output.run filters the startup marker out of streamed lines, which covers the live streaming path.removingStartupNoisecases covering marker present, absent, and as the last line.swift testrun forBrewCLIandBrewCLITests.PR checklist