-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
cygwin with win32-raw-mode enabled, console consumes all available memory. #17824
Comments
Using your test application, I was easily able to reproduce the issue by pasting a few lines of text (>100 characters) 5-10 times. It would then go out of control as you described. I believe this is a bug in cygwin. When the issue occurs, something calls (The reason it may seem like a deadlock in OpenConsole is because our input processing is just extremely slow. The input buffer implementation was unfortunately "improved" by someone many years ago in the pursuit of OOP cleanliness. We're planning to fix that soon. But making it faster will not fix this bug, it'll simply make it run OOM faster. 😄) |
Shall continue researching, might review Cygwin's console interface for any insight. Note: upon disabling win32-input-mode, the problem does not not occur. Assume there are no plans on supporting Cygwin's equiv cygwin-raw-mode, |
Currently we have no plans adding support for other input protocols ourselves, but we'd gladly accept any PRs that add support for them! |
Discussion raised within cygwin mail group. Please confirm the intended behavior of WriteConsoleInput() when win32-input-mode, is enabled? Wondering if its behavior should be to not expand key events without Vk=0/Sc=0 values, from research, these represent the expanded pseudo key events. This behavior may also address the double encoding of mouse event under win32-input-mode, |
I'm glad that you were able to fix the issue in cygwin. I'll be closing the issue then. Thank you for reporting it in their mailing list as well as fixing it! 😻 It may be worth nothing that the fix will be required even long-term. If an application requests win32-input-mode (w32im), then we'll have to respect this wish and translate any inputs to the w32im sequences, even if they come from |
Oh, I missed your question:
The intention of the protocol is to be absolutely lossless when it comes to Edit: I can confirm that mouse events are being double-encoded. I've opened #17851 to track the issue. I'll fix that ASAP and see if we can backport it. |
Windows Terminal version
1.20.11781.0
Windows build number
10.0.19045.4780
Other Software
cygwin64, either
Steps to reproduce
Application
enables win32-input-mode (\033[?9001h), fast key input triggers condition; see attached.
Test application:
Expected Behavior
Raw keys code reported without issue.
Actual Behavior
OpenConsole rapidly consumes memory and cpu, shall consume all available resources unless killed;
application becomes unresponsive.
The text was updated successfully, but these errors were encountered: