I think I found one resize bug. A ConPTY sends two WINDOW_BUFFER_SIZE_EVENT messages when the window is restored from maximize, but the first one has the wrong size (not sure of the internals of this, but it appears in conhost/tmux/pwsh, alacritty/pwsh, and Windows Terminal).
Run this program as conevents -es in conhost and a different terminal to see the difference; maximize and restore the window. For example, restoring the WinTerm window reports 119 x 46 in the WINDOW_BUFFER_SIZE_EVENT message, but GetConsoleScreenBufferInfo returns the correct value 119 x 32.
_Originally posted by @parkovski in https://github.com/microsoft/terminal/issues/1465#issuecomment-506924361_
Holy crap, I saw the cause of this in https://github.com/microsoft/terminal/issues/1795#issuecomment-516014782.
We perform a resize on the conpty buffer twice, once to resize the width, and again to resize the height. By resizing _twice_, we hit the code path that emits a WINDOW_BUFFER_SIZE_EVENT twice. This is obviously insane, so there's gotta be a better way.
Most helpful comment
Holy crap, I saw the cause of this in https://github.com/microsoft/terminal/issues/1795#issuecomment-516014782.
We perform a resize on the conpty buffer twice, once to resize the width, and again to resize the height. By resizing _twice_, we hit the code path that emits a
WINDOW_BUFFER_SIZE_EVENTtwice. This is obviously insane, so there's gotta be a better way.