Terminal: Writing into inactive screen buffer is broken

Created on 16 Oct 2018  ·  3Comments  ·  Source: microsoft/terminal

Windows Version 10.0.17763.1

CreateConsoleScreenBuffer function:

A console can have multiple screen buffers but only one active screen buffer. Inactive screen buffers can be accessed for reading and writing, but only the active screen buffer is displayed. To make the new screen buffer the active screen buffer, use the SetConsoleActiveScreenBuffer function.

This functionality is broken - text sent to the inactive screen buffer ends up in the active and thus visible on the screen.

It does not happen in Legacy mode.

A minimal project to reproduce the issue attached.

AlternativeScreenBufferBug.zip

Product-Conhost Resolution-Fix-Committed Work-Item

Most helpful comment

Thanks. Fortunately/unfortunately you're on a roll and filing bugs faster than I can investigate and fix them.

I have filed this internally as MSFT:19317384. I'll get to it when I have time.

All 3 comments

Thanks. Fortunately/unfortunately you're on a roll and filing bugs faster than I can investigate and fix them.

I have filed this internally as MSFT:19317384. I'll get to it when I have time.

It's worth mentioning that this only happens when running from Visual Studio, which does it through its own VsDebugConsole.exe helper by default.

OK. I've investigated this, crafted a fix, had it reviewed, and checked it in as of today.

I've also installed a variation on the sample you provided into our feature test suite to ensure that we don't mess this up again in the future. Or at least that we don't mess it up in this very specific way. :P

Thank you very, very much for providing the minimal repro code. It dramatically accelerated the pace at which I could turn around this bug.

It should reach Insiders builds in about 3 weeks.

Was this page helpful?
0 / 5 - 0 ratings