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

Output is corrupted when doing exit_code #590

Open
ruudk opened this issue Dec 5, 2024 · 0 comments
Open

Output is corrupted when doing exit_code #590

ruudk opened this issue Dec 5, 2024 · 0 comments

Comments

@ruudk
Copy link
Contributor

ruudk commented Dec 5, 2024

I have the following task:

#[AsTask(name: 'twig-cs-fixer')]
function twigcsfixer(
    #[AsOption(mode: InputOption::VALUE_NEGATABLE)]
    bool $fix = true,
): int {
    if ( ! fs()->exists('vendor')) {
        composer_install();
    }

    return exit_code(sprintf('vendor/bin/twig-cs-fixer %s', $fix ? 'fix' : 'check'));
}

I noticed for a long time now, that the output sometimes gets corrupted when the output is a bit longer than let's say 20 lines.

I always thought it was my new terminal Ghostty or my custom PHPStan error formatter.

But today, I noticed the same problem in PHPStorm's terminal and with another program: Twig CS Fixer.

Screenshot 2024-12-05 at 10 29 29@2x

I have the feeling this is because the stdout and stderr are writing over each other together with terminal coloring.

It doesn't always happen. Sometimes, it resolves itself after a few runs (indicating it's a timing issue).

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

No branches or pull requests

1 participant