Console-Docs icon indicating copy to clipboard operation
Console-Docs copied to clipboard

Can we please have clearer documentation on what the failure behavior of SetConsoleMode?

Open zadjii-msft opened this issue 2 years ago • 1 comments

Can we please have clearer documentation in MSDN on what the failure behaviour of these functions is? For instance:

  • It's not documented whether we need to set the buffer back to the original mode on failure.
  • It's not documented what error codes we can expect to get from GetLastError and whether it's even possible to handle them (it could be any of 16000 errors!).
  • It's not documented whether buffers and their modes persist when the program exits.

I understand the need to keep suboptimal behaviour because old versions of powershell were incorrect, but I need to know about it in advance so that I can make my programs correct.

Originally posted by @Gyross in https://github.com/microsoft/terminal/issues/13738#issuecomment-1216006957

zadjii-msft avatar Aug 16 '22 11:08 zadjii-msft

Also:

  • Which output modes are inherited when a new screen buffer is created. E.g.; I've seen ENABLE_VIRTUAL_TERMINAL_PROCESSING inherited, while other modes like ENABLE_WRAP_AT_EOL_OUTPUT are reset.

Thanks.

Gyross avatar Aug 16 '22 22:08 Gyross