Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
windows: monitorTtySize correctly by polling #11843
This change makes
That should be good enough to emulate SIGWINCH semantics on Windows.
I'm not sure if there's a better way to do it on windows, if so,
Also not sure if this should go to 1.6 or not, just a UX improvement.
Signed-off-by: Ahmet Alp Balkan firstname.lastname@example.org
OK I found some more info:
So it is possible to do this without polling.
However, implementing that is probably beyond my ability at this time (I'm not very familiar with console input buffer is processed) and this proposed solution just works, too. Implementing ENABLE_INPUT_WINDOW would also require refactoring to invert the flow (i.e. currently the monitorTtySize is in api/client package and asks term package for events/size. If we refactor it would be platform specific and this method would go to terminal packages i.e. pkg/term & pkg/term/winconsole).
@ahmetalpbalkan I still see the panic unfortunately :( I believe it's as the buffer grows. After doing opening vim a couple of times, I made the window full screen and it panicked. But it's not related to the winresize itself, more of filling in buffers (and there are some dangling pointers in there that would need to be hunted somehow).