Skip to content

Render Live and TaskProgress live inside a command - #82

Merged
imanimanyara merged 1 commit into
mainfrom
fix/live-render-through-output-style
Oct 13, 2026
Merged

imanimanyara merged 1 commit into
mainfrom
fix/live-render-through-output-style

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

Live and TaskProgress checked $output instanceof ConsoleOutputInterface. Inside a real command, Illuminate\Console\Command::run() hands handle() an OutputStyle, which is not one, so spinners, animated bars and task trees always took the static path, even on a terminal.

  • New internal Tools\Support\LiveOutput::of() resolves the console to redraw on. It unwraps through ErrorOutput::unwrap(), which is now the one implementation shared with ErrorOutput::of() (Route deprecated-alias warnings and writer errors to stderr #77). It also requires a decorated output, the rule Symfony's ProgressBar uses before overwriting.
  • Live and TaskProgress use it. The TTY gate stays in Capabilities::isInteractive().
  • CHANGELOG [Unreleased]: one Fixed entry and one Changed entry. An undecorated console output, such as --no-ansi, now renders statically.

Tests

tests/Tools/Unit/Commands/LiveRenderRoutingTest.php runs two commands through the real Command::run(), using a decorated ConsoleOutputInterface stand-in that hands out real sections:

  • With a decorated TTY, Live and TaskProgress open a section and emit cursor sequences.
  • An undecorated output, or no TTY, still falls back to static output.

Fail-first: before the fix, the two live cases fail (0 is identical to 1 sections opened) and the four fallback cases pass.

Local: pest 567 passed, phpstan clean, rector clean, pint clean against package-tools' pint.json.

Command::run() hands handle() an OutputStyle, which is not a
ConsoleOutputInterface, so both widgets always took the static path.
Resolve the console through a new LiveOutput helper that unwraps the
style via ErrorOutput::unwrap(), the one shared implementation, and
also requires a decorated output so --no-ansi gets no cursor codes.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@imanimanyara
imanimanyara merged commit da18826 into main Oct 13, 2026
14 checks passed
@imanimanyara
imanimanyara deleted the fix/live-render-through-output-style branch October 13, 2026 13:34
@imanimanyara imanimanyara mentioned this pull request Oct 13, 2026
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