Flicker free console updates with virtual terminal sequences

Viewed 12

In a C# console application for Windows, I'm am using the Windows Console API WriteConsoleOutput (via PInvoke) to write an entire buffer in a single operation to prevent flickering. This works fine.

Microsoft recommends using virtual terminal sequences to interact with the console. These sequences are great, as they offer much better output, such as colors, etc.

But, as I understand it, WriteConsoleOutput cannot be used with escape sequences (see CHAR_INFO).

My question is,

How can I use virtual terminal sequences to write to the console flicker-free?

I'd like to update different parts of the screen with different characters and colors. Doing this by chaining a lot of Console.Write() and Console.SetCursorPosition will cause a lot of flickering and reduce framerate.

What is the virtual terminal equivalent of writing an entire buffer?

0 Answers
Related