charmbracelet / vhs

Your CLI home video recorder 📼
MIT License
15.2k stars 258 forks source link

Add support for synchronized output to prevent tearing #516

Open JakeWharton opened 2 months ago

JakeWharton commented 2 months ago

If I run an application which continuously sends large chunks of text + ANSI control sequences to stdout, I sometimes see the cursor jump to the middle of the rendering. The application is enabling mode 2026 and sending the end-of-frame sequences. VHS should track whether this mode is enabled and not re-render a frame until it sees the end-of-frame sequence.

More details available at https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036

Delta456 commented 1 month ago

Is this Windows? I can't reproduce this on Linux and Mac.

JakeWharton commented 1 month ago

I'm on Mac. I can try to write a repo. I suspect two echos each having half the sync marker with a sleep in between might do it.

Delta456 commented 3 weeks ago

Please do