You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift+Enter always submits, breaking PSReadline features [Windows.Terminal] #530
Your Windows build number: (Type ver at a Windows Command Prompt)
Microsoft Windows [Version 10.0.18362.86]
What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
Trying to add an empty line in a multi-line input by pressing Shift + Enter with PSReadline in PowerShell
What's wrong / what should be happening instead:
Shift+Enter is treated as Enter, and it tries to run my incomplete command line
Reacted by Maximilian Orsley, Keith Hill, Morten Gjesing, Anton Zhvakin, wisemoth, rokumaru, Reilly Wood, Dongbo Wang, Daniel Niccoli, Mathias R. Jessen and 5 more
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.
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+ chords don't work either. 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: PowerShell/PSReadLine#877Ctrl+. 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.
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 ...
I did this but then I started getting ;2u instead of space when lingering on the shift key while pressing space. Excluding shift + space did the trick.
; Sends Ctrl+Shift+Enter when Claude Code is active, otherwise normal Shift+Enter#Persistent#SingleInstance force; Shift+Enter hotkey+Enter::
WinGet, activeProcess, ProcessName, A
WinGetTitle, activeTitle, A
; Check if Windows Terminal with Claude Code (title starts with U+2733)if (activeProcess = "WindowsTerminal.exe"&&SubStr(activeTitle, 1, 1) = Chr(0x2733))
{
; Claude Code is active - send Ctrl+Shift+EnterSend^+{Enter}
}
else
{
; Not Claude Code - pass through normal Shift+EnterSend+{Enter}
}
return
I use this AHK script to send ctrl+shift+enter when I send shift+enter if the active window is WindowsTerminal.exe and has the claude code unicode character in it - U+2733
Activity
zadjii-msft commentedon May 7, 2019
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 (inInputStatemachineEngine.*) 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.
Jaykul commentedon May 8, 2019
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+Enterinstead... 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...
pingzing commentedon May 17, 2019
This actually seems to be a bit of a broader problem--a lot of PSReadLine hotkeys that use Ctrl+ chords don't work either.
Ctrl+SpaceandCtrl+.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: PowerShell/PSReadLine#877
Ctrl+.is interpreted asCtrl+@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?flxflx commentedon Jun 25, 2019
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.
krokofant commentedon Dec 5, 2019
Any known workaround for this?
herolover commentedon Dec 23, 2019
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.
Jaykul commentedon Dec 24, 2019
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 ...
7 remaining items
Update Fork (#1)
zsimic commentedon Jan 7, 2021
I noticed that latest 1.4.3243.0 seems to still be sending (as observed with
showkey -ain an ubuntu wsl2 session):0x0dforenter0x0dalso forshift+enter0x0aforctrl+enterctrl+shift+enterI worked around it by adding these actions to my
settings.json:And similarly for
shift+space:adouzzy commentedon Aug 4, 2021
This is gold.
with https://www.asciitable.com/ , you can set any combination on shortcuts.
My emacs is flying in the terminal now.
Huge thanks!
jbsilva commentedon Apr 4, 2023
Same problem still happening in 2023 in Version: 1.12.10983.0.
This worked for me.
CervEdin commentedon Apr 5, 2023
I did this but then I started getting
;2uinstead of space when lingering on the shift key while pressing space. Excludingshift + spacedid the trick.revoconner commentedon Nov 25, 2025
I use this AHK script to send ctrl+shift+enter when I send shift+enter if the active window is WindowsTerminal.exe and has the claude code unicode character in it - U+2733
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…
fix(input): Windows 启用 win32-input-mode(DECSET 9001)修复 Shift+Enter 无法…