Skip to content

Add Plain Progress Output Mode#1367

Merged
jglogan merged 5 commits intoapple:mainfrom
nrthakur:nik/feat/plain-progress-output-mode
Apr 2, 2026
Merged

Add Plain Progress Output Mode#1367
jglogan merged 5 commits intoapple:mainfrom
nrthakur:nik/feat/plain-progress-output-mode

Conversation

@nrthakur
Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Adds a plain progress output mode (--progress plain) that outputs newline-separated progress lines without ANSI escape sequences. This is useful for CI environments, piped output, and non-TTY contexts where ANSI cursor control is not supported. Unlike --progress ansi, plain mode works even when stderr is not a TTY.

Related: #1365, #641, #808

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Copy link
Copy Markdown

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

Adds a new plain-text progress rendering mode (--progress plain) intended for CI/piped output where ANSI cursor control isn’t supported, and wires it through the CLI into the TerminalProgress library.

Changes:

  • Added ProgressConfig.outputMode with .ansi (default) and .plain modes.
  • Updated ProgressBar rendering/terminal behavior to avoid ANSI cursor control in plain mode and emit newline-terminated lines.
  • Added CLI flag support (plain) and tests for plain-mode draw() formatting.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Tests/TerminalProgressTests/ProgressBarTests.swift Adds tests for plain-mode config/draw behavior.
Sources/TerminalProgress/ProgressConfig.swift Introduces outputMode and OutputMode enum (default .ansi).
Sources/TerminalProgress/ProgressBar.swift Switches terminal behavior by output mode; adds plain-mode render throttling.
Sources/TerminalProgress/ProgressBar+Terminal.swift Emits newline output for plain mode; avoids cursor reset in plain.
Sources/TerminalProgress/ProgressBar+State.swift Adds lastPlainRenderTime state for throttling plain output.
Sources/Services/ContainerAPIService/Client/Flags.swift Extends --progress option to accept plain.
Sources/ContainerCommands/** Wires --progress plain into push/pull/run progress configuration.

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

@nrthakur
Copy link
Copy Markdown
Contributor Author

@jglogan hoping for a review!

@jglogan jglogan requested a review from dkovba March 31, 2026 23:28
@dkovba
Copy link
Copy Markdown
Contributor

dkovba commented Apr 1, 2026

Thank you for the contribution!

@nrthakur nrthakur requested a review from dkovba April 1, 2026 01:01
Copy link
Copy Markdown
Contributor

@dkovba dkovba left a comment

Choose a reason for hiding this comment

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

👍

@nrthakur nrthakur requested a review from dkovba April 1, 2026 01:22
@nrthakur
Copy link
Copy Markdown
Contributor Author

nrthakur commented Apr 1, 2026

@dkovba Apologies, CI was failing, pushed another commit. Would you mind taking another look 👀

Copy link
Copy Markdown
Contributor

@manojmahapatra manojmahapatra left a comment

Choose a reason for hiding this comment

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

Suggestion: can we update/regenerate docs/command-reference.md in this PR so plain is discoverable in the repo docs?

@jglogan jglogan merged commit 7451345 into apple:main Apr 2, 2026
3 checks passed
@jglogan
Copy link
Copy Markdown
Contributor

jglogan commented Apr 2, 2026

@nrthakur Thanks for the contribution!

@manojmahapatra
Copy link
Copy Markdown
Contributor

I see that this is already merged. Minor update #1379 I think nice-to-have.

@nrthakur nrthakur mentioned this pull request Apr 3, 2026
7 tasks
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.

6 participants