Skip to content

Handle shell startup output in installed package JSON - #157

Draft
joseph1020 wants to merge 1 commit into
Homebrew:mainfrom
joseph1020:fix/json-shell-startup-output
Draft

Handle shell startup output in installed package JSON#157
joseph1020 wants to merge 1 commit into
Homebrew:mainfrom
joseph1020:fix/json-shell-startup-output

Conversation

@joseph1020

Copy link
Copy Markdown

Summary

Allow the Installed repository to decode brew info --installed --json=v2
when interactive-shell startup output appears before Homebrew's JSON.

This was reproduced with iTerm2 shell integration emitting OSC 1337 sequences
before an otherwise valid Homebrew JSON payload.

Changes

  • Preserve the existing login/interactive shell behavior.
  • Recover the Homebrew JSON payload after leading shell startup output.
  • Add a regression test for JSON-like shell output before the real payload.

Testing

  • Syntax-checked the changed Swift files.
  • git diff --check.
  • Targeted test not run locally due to local toolchain limitations.

PR checklist

  • Have you followed this repository's contribution and workflow guidance?
  • Have you explained what changed and why this should land now?
  • Have you run relevant local checks for the changed scope?
  • Are changes scoped and free of unrelated modifications?

  • AI was used to generate or assist with generating this PR.
  • ChatGPT and OpenAI Codex assisted with reproducing the failure, reviewing
    the decoding boundary, and drafting the regression and implementation.
    I manually reproduced the issue and reviewed the final diff.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will not be merging any community PRs until after Homebrew 7.0.0 is released.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants