Repository navigation
Render Live and TaskProgress live inside a command - #82
Merged
Merged
Conversation
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.
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
LiveandTaskProgresschecked$output instanceof ConsoleOutputInterface. Inside a real command,Illuminate\Console\Command::run()handshandle()anOutputStyle, which is not one, so spinners, animated bars and task trees always took the static path, even on a terminal.Tools\Support\LiveOutput::of()resolves the console to redraw on. It unwraps throughErrorOutput::unwrap(), which is now the one implementation shared withErrorOutput::of()(Route deprecated-alias warnings and writer errors to stderr #77). It also requires a decorated output, the rule Symfony'sProgressBaruses before overwriting.LiveandTaskProgressuse it. The TTY gate stays inCapabilities::isInteractive().[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.phpruns two commands through the realCommand::run(), using a decoratedConsoleOutputInterfacestand-in that hands out real sections:LiveandTaskProgressopen a section and emit cursor sequences.Fail-first: before the fix, the two live cases fail (
0 is identical to 1sections opened) and the four fallback cases pass.Local: pest 567 passed, phpstan clean, rector clean, pint clean against package-tools'
pint.json.