-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
ConPTY doesn't set KeyEvent::_virtualScanCode for certain characters like : (which bothers GoW less) #2873
Comments
|
according to "less --version" I am running less version 378 |
I think @DHowett-MSFT meant more of "are you using wsl's |
I downloaded "less" a long time ago. I don't remember exactly where I got it. The command "less --version" produces the following less 378 less comes with NO WARRANTY, to the extent permitted by law. In the documentation I got at the time, there is the following paragraph:
Although I have cygwin, I do not use it. |
So the less I have on WSL is just about 100 versions more updated - could you maybe try a newer
I can only find posts about What keyboard layout are you using? |
I must be having a slow day. Who or what is WSL ? |
Sorry, it just occured to me that WSL == Windows Subsystem for Linux |
Does anyone know where I can find a compiled binary version of less ? So far the only thing I have found is source code and I have always had issues trying to compile anything that requires the bourne shell to run a script named "configure" which starts the whole build process. On my windows 10 64 bit system I can't get sh.exe to run properly |
That's a really good question, honestly. It looks like the GoW project produces binaries of these tools with reasonable frequency, but their terminal emulator bridge leaves a little bit to be desired. Perhaps their Sorry, I know it's not much. 😄 |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
The GoW version of less did not solve the problem. I am continuing my search for some kind of solution. |
That is very good news for us, because now we have learned of a distribution of less that we can use for a repro. Thank you! What keyboard layout are you using? Standard en-US PC104? |
I am not sure about the exact specs for my keyboard, but it is definitely en-US. I am unable to determine if it is PC104 , I have checked in the control panels and nothing speaks of PC104 |
just for the record I have the same issue wether I use my laptop keyboard or my wired USB keyboard |
Try |
I already had git for windows 2.15.0 on my system. I was not aware that it had all those extra executables. It had less version 481. That version of less seems to be working just fine ! That solves my specific issue. Thanks to all who helped ! |
And we've got a root cause, too! It looks like some versions of less for windows are checking the scancode of the keyboard key that's pressed, and when that key comes in off a pty (which Windows Terminal, VSCode, Visual Studio, etc. use), that scancode isn't set. pseudoconsole
conhost
|
And as a final followup, it's because somewhere deep in the console host, we're doing a "vkey to vsc" translation, but we're providing it a character instead of a vkey. 🤦♂ |
diff --git a/src/types/convert.cpp b/src/types/convert.cpp
index c2049ded9..bc87bab18 100644
--- a/src/types/convert.cpp
+++ b/src/types/convert.cpp
@@ -206,7 +206,8 @@ std::deque<std::unique_ptr<KeyEvent>> SynthesizeKeyboardEvents(const wchar_t wch
SHIFT_PRESSED));
}
- const WORD virtualScanCode = gsl::narrow<WORD>(MapVirtualKeyW(wch, MAPVK_VK_TO_VSC));
+ auto vk = keyState & 0xFF;
+ const WORD virtualScanCode = gsl::narrow<WORD>(MapVirtualKeyW(vk, MAPVK_VK_TO_VSC));
KeyEvent keyEvent{ true, 1, LOBYTE(keyState), virtualScanCode, wch, 0 };
// add modifier flags if necessary |
🎉This issue was addressed in #3199, which has now been successfully released as Handy links: |
Environment
Windows 10
Any other software?
The text was updated successfully, but these errors were encountered: