-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equivalent of SIGWINCH? #305
Comments
There's also
The CR killed the horizontal position reporting interactively, but at least you can see my window is 47 rows high. Again, this would need to be polled but at least it's somewhat cross platform. Other techniques I've seen on other platforms (osx,linux) is either shelling out to |
Unfortunately, the only SIGWINCH equivalent on Windows is, as you've noted, using |
Well, thanks for the clarification. The situation feels kind of disappointing, though. It's hard to qualify a console system as "VT-speaking" when it can't get If all other console input types are converted anyway, maybe we can just do a simple hack and |
@zadjii-msft Mike, I've been playing with this the last few days and noticed that using |
I'm gonna go ahead and link in #281 here - that thread has WAY more information on basically the same topic. In fact, we shout probably just commit to that thread being the master thread for all window WINDOW_BUFFER_SIZE_EVENT / SIGWINCH discussion. |
Found this thread while I was looking for inspiration, eventually realised WM_ERASEBKGND was better suited since you just need to have a static global by your hook and compare against that, here's a snippet from my code for how I'm planning to implement it:
I might need to tweak it a little for non-console apps but that's the jist of it. Events like |
FWIW I fully suspect that won't work in the Windows Terminal, since the HWND returned by Also, it probably won't work if the console/Terminal is minimized, hidden, etc. |
Well given the snippet |
After reading through the blog post and relevant MSDN pages, I didn't find a way for a modern Windows console app to detect when its output console gets resized. On Unix we have
SIGWINCH
, but on Windows we only haveReadConsoleInput
andWINDOW_BUFFER_SIZE_EVENT
, which seems awkward when used alongside simplestdin
reading (will they fight for normal input events?).Can someone share some light on this situation?
Thanks.
The text was updated successfully, but these errors were encountered: