Skip to content

brew-rs/fetch: use functions from tty module#21825

Merged
MikeMcQuaid merged 2 commits intomainfrom
brew-rs-use-more-tty
Mar 24, 2026
Merged

brew-rs/fetch: use functions from tty module#21825
MikeMcQuaid merged 2 commits intomainfrom
brew-rs-use-more-tty

Conversation

@botantony
Copy link
Copy Markdown
Member


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

I didn't check this module #21809

Signed-off-by: botantony <antonsm21@gmail.com>
Copilot AI review requested due to automatic review settings March 24, 2026 19:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors brew-rs fetch to rely on the shared utils::tty module for ANSI color and terminal control sequences, consolidating previously inlined escape codes and expanding the TTY helper surface.

Changes:

  • Add green ANSI support and new cursor/line control helpers to utils::tty.
  • Replace hardcoded ANSI escape sequences in fetch with calls into utils::tty.
  • Simplify fetch_bottle/print_downloaded_bottle by removing the explicit tty_output parameter and delegating color decisions to tty.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/rust/brew-rs/src/utils/tty.rs Adds green ANSI support and introduces reusable cursor/line control helpers for terminal output.
Library/Homebrew/rust/brew-rs/src/commands/fetch.rs Switches progress rendering and status output to use the new tty helpers instead of embedded escape sequences.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit 4760bd5 Mar 24, 2026
40 checks passed
@MikeMcQuaid MikeMcQuaid deleted the brew-rs-use-more-tty branch March 24, 2026 20:04
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.

3 participants