1

What is the preferred way to respond to changes in the buffer size for Windows Terminal? With an old-school command prompt, I would get a reference to the window handle for the console and hook the events from there. Is there an equivalent for PseudoConsoles?

elaverick
  • 314
  • 1
  • 2
  • 13

1 Answers1

1

In C++, you'd use ReadConsoleInput as in Reading Input Buffer Events to listen for WINDOW_BUFFER_SIZE_EVENT messages.

Alas, I'm not familiar enough with C# to know the idiomatic way of doing this. Surprisingly, I'm not seeing a simplified version of that in the Console API. You might need to pinvoke to do this.

zadjii
  • 529
  • 2
  • 4