Skip to content
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

Avoid console input behavior in windows 10 #5634

Merged
merged 1 commit into from Mar 16, 2022

Conversation

YO4
Copy link
Contributor

@YO4 YO4 commented Mar 9, 2022

Avoid console input behavior in windows 10.
This fixes https://bugs.ruby-lang.org/issues/18588

When ANSI versions of PeekConsoleInput read multibyte charactor partially, subsequent ReadFile returns wrong data on newer Windows 10 versions (probably since Windows Terminal introduced).
To avoid this, use Unicode version of of PeekConsoleInput/ReadConsole.

ref. microsoft/terminal#12626

Avoid console input behavior in windows 10.
This fixes https://bugs.ruby-lang.org/issues/18588

When ANSI versions of PeekConsoleInput read multibyte charactor partially, subsequent ReadFile returns wrong data on newer Windows 10 versions (probably since Windows Terminal introduced).
To avoid this, use Unicode version of of PeekConsoleInput/ReadConsole.
@nobu nobu changed the title fix-windows-console-input Avoid console input behavior in windows 10 Mar 16, 2022
@nobu nobu merged commit 5d90c60 into ruby:master Mar 16, 2022
YO4 added a commit to YO4/ruby that referenced this pull request Sep 2, 2022
UnicodeChar with lower byte == 0 has dropped accidentaly
this is additional fix for ruby#5634
YO4 added a commit to YO4/ruby that referenced this pull request Sep 2, 2022
classic console(conhost.exe) reports an input with ALT+NUMPAD as VK_MENU, KeyUp, and uChar!=0.
additional fix for ruby#5634
nobu pushed a commit that referenced this pull request Sep 8, 2022
UnicodeChar with lower byte == 0 has dropped accidentaly
this is additional fix for #5634
nobu pushed a commit that referenced this pull request Sep 8, 2022
classic console(conhost.exe) reports an input with ALT+NUMPAD as VK_MENU, KeyUp, and uChar!=0.
additional fix for #5634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants