Reporting window size events in stdin #14975
-
Windows Terminal version1.16.10261.0 Windows build number10.0.19044.0 (21H2) Other SoftwareSteps to reproduceI am setting my input handle with Stdout's mode is left as default ( Then I read from my Expected BehaviorSome sort of binary/VT sequence of bytes to represent a window resize event. Actual BehaviorKeyboard events are present in The phrase Is there anything in my configuration amiss? Is there a gentle The example in https://learn.microsoft.com/en-us/windows/console/reading-input-buffer-events works fine without additional configuration. Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey @ShrykeWindgrace! This is one place where we could seriously do better. Alright, here goes. Right now, the window size events come in in the form of We don't have a VT encoding for window size events for one really annoying reason: nobody does! On non-Windows platforms, these things come in via an asynchronous signal So, I can give you these two things:
I briefly had a prototype (branch on this repo that mentions Hope that helps! I'm gonna mark this issue up as a question with resolution=answered and later convert it to discussion. Please feel free to come back with any followups! |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the comprehensive answer! I'll see what I can do with this info =) |
Beta Was this translation helpful? Give feedback.
-
Nah, it doesnt work for vertical resize, the Y number is always 9001 for conhost no matter how you resize the window. its not about the window, its about the buffer. even for X/horizontal, one still must fetch the full info to determine the changes properly. |
Beta Was this translation helpful? Give feedback.
Hey @ShrykeWindgrace! This is one place where we could seriously do better. Alright, here goes.
Right now, the window size events come in in the form of
INPUT_RECORD
structures when you useReadConsoleInputW
. Even in VT mode.We don't have a VT encoding for window size events for one really annoying reason: nobody does! On non-Windows platforms, these things come in via an asynchronous signal
SIGWINCH
, and are read out of the tty via theTIOCGSZ
IOCTL. We don't have either of those things on which to build a good window size notification primitive, so instead it comes in as raw events in the input stream.So, I can give you these two things: