Comment by albertzeyer

3 years ago

I think it is possible to avoid the flickering via double-buffering, right?

I don't exactly remember how that works. There is the alternate screen buffer:

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-T...

Maybe there was also a special sync terminal escape code or so.

Short of swapping in a new image during the vertical blanking interval, you will never have a "flicker" free image. Any "flicker" that can happen from no double buffer can happen because of no vsync. This begs the question why you would ever want to show graphics in the terminal in the first place. I might be wrong, but in my experience most terminal emulators do not look like they can update the full screen 60 times per second. If everyone started doing graphics in the terminal, we will have to find what method can actually output fast enough, or create it and standardize it, and soon we will have a new graphics API that all terminal emulators must conform to or not, and a way for applications to detect whether the terminal supports it.