Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix output of escape characters when using NullOutput interface #28

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

jessarcher
Copy link
Member

This PR fixes an issue when the output interface has been set to a NullOutput instance (e.g. when using the callSilent method in Laravel).

Currently, cursor manipulation and erase escape sequences are written directly to STDOUT because they interfere with the trailing newline calculation. However, when a NullOutput instance is used, the escape sequences are still output while the rest of the output is dropped.

When using Laravel's OutputStyle, we can bypass its newline calculation by writing directly to the underlying OutputInterface using the getOutput method.

When used without Laravel, I've added a writeDirectly method to the ConsoleOutput class that bypasses the calculation.

This partially solves #22, but a framework PR is required to completely solve it.

@taylorotwell taylorotwell merged commit a5295e1 into main Aug 2, 2023
5 checks passed
@taylorotwell taylorotwell deleted the escape-chars-via-output branch August 2, 2023 14:00
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