-
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
Ctrl+j = Ctrl+return for some reason #6912
Comments
I took a look at the result of PowerShell's conhost.exe:
openconsole.exe:
It's the same LF (U+000A) Unicode character in each case. But the virtual-key code from conhost.exe is 0x4A ("J"), while openconsole.exe under Windows Terminal returns 0xD ( |
This is probably caused by conpty arbitrarily picking one of the two keys. I bet this is better on Terminal Preview, 1.1+. Could you verify for me? For more info, check out #4999 |
@zadjii-msft You would be correct. On Windows Terminal 1.1.1812.0:
And key combinations which use Ctrl+j work in Emacs as well. 😄 |
Root cause is that there is no encoding for It just so happens that Windows once let people get more info than that. /dup #4999 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Thanks Microsoft Terminal team for such a switch response and resolution 👍 |
Environment
I initially saw this behavior in PowerShell 7. However I have reproduced it in
cmd.exe
as well as the old powershell (powershell.exe
compared to the newpwsh.exe
).Since this issue has to do with key chords here is my full Windows Terminal configuration file: https://gist.github.com/Noah-Huppert/6d73079767fcc08edea810cd6beb5a89
One will notice that in an effort to isolate the cause of this bug I have unbound every command that was in the
default.json
keybindings
section except for copy and paste.Steps to reproduce
[console]::ReadKey()
Expected behavior
The key chord sent to the shell should be J with a Control modifier. The
ReadKey()
command should return:Actual behavior
The key chord sent to the shell is Enter. The
ReadKey()
command returns:This behavior only occurs in Windows Terminal. If I open up Powershell 7 in the Cmder terminal emulator the expected behavior occurs. The behavior described here in the actual behavior section seems to only occur in Windows Terminal on my machine.
This behavior occurs in any application running within Windows Terminal. Which is what has led me to believe that this is an issue with Windows Terminal and not something else. I initially saw this behavior in Emacs where it kept saying
C-<return>
was not bound to any commands when I would pressC-j
. I tested Emacs inpowershell.exe
andcmd.exe
within Windows Terminal and was able to reproduce the bug. Making me confident thatpwsh.exe
norpowershell.exe
norcmd.exe
are causing the issue. The steps to reproduce above are a minimal reproducible example. I write this paragraph only to show that this issue does not have to do with any specifics of how the PowerShell[console]::ReadKey()
works.The text was updated successfully, but these errors were encountered: