vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.04k stars 1.79k forks source link

TUI often garbled by errors in tasks #9057

Open alecmev opened 3 weeks ago

alecmev commented 3 weeks ago

Verify canary release

Link to code that reproduces this issue

https://github.com/alecmev/turbopack-repro-9057

What package manager are you using / does the bug impact?

npm, Yarn v2/v3/v4 (node_modules linker only)

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

2.0.15-canary.3

Describe the Bug

Certain types of output leak between tasks. Probably stderr? Not sure. Something gets printed in a failing task, and that piece of text is visible in all tasks, not just the failing one. It gets overlaid by characters of an active pane, but only in non-empty character slots. Here's a screenshot from the repro:

Screenshot 2024-08-24 at 16 54 07

The stuff on the line that starts with foo2 belongs to bar and has nothing to do with foo. This reproduces reliably in Terminal.app and Alacritty. Experiencing this since 2.0.6 (the version I started with).

It's a bit suspicious that nobody else is reporting this, so it could be my problem, but the issue persists for over a month now, across at least two very different terminal emulators (with untouched vanilla settings), two very different package managers (I use Yarn 4, but made the repro with npm for simplicity) and two different shells (Z and Bash).

The corruption in the repro is mild, to keep it minimal. In a real project, with several tasks failing and large error messages, TUI becomes effectively unusable. The corruption affects the sidebar too if the error doesn't fit on a single line:

Screenshot 2024-08-24 at 17 06 41

White background is Terminal.app, black background is Alacritty. They behave exactly the same. The Alacritty screenshot is what it looks like after interaction (switching between the two tasks) in a narrow window.

Expected Behavior

No leaked output.

To Reproduce

Clone the repro and run npm test.

Additional context

No response

alecmev commented 3 weeks ago

A screenshot from my colleague's iTerm2:

image