ver at a Windows Command Prompt)Microsoft Windows [Version 10.0.18362.86]
Trying to add an empty line in a multi-line input by pressing Shift + Enter with PSReadline in PowerShell
Shift+Enter is treated as Enter, and it tries to run my incomplete command line
So I'm not sure this is fixable without a _lot_ of work.
Because the Windows Terminal is using ConPTY as a backend, we can only send keypresses to the attached client app that are encodable by VT sequences. Unfortunately, there's no way to differentiate between Enter and Shift+Enter with just VT.
So, we need to add support for encoding entire INPUT_RECORDs as VT sequences. Then add support to conpty (in InputStatemachineEngine.*) for parsing such an input record. Then we need to enable the terminal to tell conpty that it should expect such a type of input sequences, and the terminal needs to be able to synthesize them.
It's something that's doable, but not without at least a weeks worth of work, not including testing.
Ouch. Didn't even think of that.
At least in PSReadLine it's settable, so I will just have to try to learn to use Ctrl+Enter instead
... that seems to send a linefeed instead of a carriage return, so it's detectable.
There's probably a bigger picture here about helping those of us who aren't used to VT learn which combinations just aren't going to work...
This actually seems to be a bit of a broader problem--a lot of PSReadLine hotkeys that use Ctrl+Ctrl+Space and Ctrl+. come to mind as well.
EDIT: Interestingly, it seems similar to the issue experienced by xterm.js-based terminal emulators on Windows, as noted in the PSReadLine repo: https://github.com/PowerShell/PSReadLine/issues/877 Ctrl+. is interpreted as Ctrl+@ in the Windows Terminal as well, for example. At a guess, because xterm.js on Windows uses WinPTY which does a pretty similar thing to ConPTY's VT processing?
The issue seems to prevent the typing of certain characters on non-US keyboard layouts. For example, I cannot type backspace (alt-gr+?) on my German keyboard. This makes Terminal pretty much unusable for me.
Any known workaround for this?
It's really important. In Far I can't open a windows explorer by pressing shift+enter, or call a context menu by pressing a corresponding key of keyboard.
I think the workaround is to use different hotkeys or different (VT-capable) apps.
The bottom line is that Windows Terminal is a _Terminal Emulator_, and both it and ConPTY are inherently limited by (really ancient) standards. I'm almost positive that "we" (the community of Windows users?) don't want to simultaneously "embrace and extend" those standards 馃槈
I still think the best solution is just education about what key combinations can't be encoded ...
:tada:This issue was addressed in #6309, which has now been successfully released as Windows Terminal Preview v1.1.1671.0.:tada:
Handy links:
Most helpful comment
The issue seems to prevent the typing of certain characters on non-US keyboard layouts. For example, I cannot type backspace (alt-gr+?) on my German keyboard. This makes Terminal pretty much unusable for me.