Shift+Enter inconsistently creates newline in Cursor terminal (varies per session)
Description
Shift+Enter behavior is inconsistent in Cursor's integrated terminal. In some sessions it correctly inserts a newline, in others it submits the input (same as Enter). This happens within the same folder and same keybindings.json configuration — the behavior varies per terminal session.
Environment
- Claude Code v2.1.78
- Cursor (latest)
- macOS (Darwin 24.6.0)
terminal.integrated.defaultLocation: "editor"
Steps to Reproduce
- Open a folder in Cursor
- Open multiple Claude Code sessions (terminal tabs)
- Press Shift+Enter in each session's input
- Some sessions create a newline, others submit the input
Configuration
/terminal-setup installs the following keybinding (as expected):
{
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "\^[\r"
},
"when": "terminalFocus"
}
This binding is confirmed to fire correctly (verified by testing in a bash terminal where it sends ESC+CR). However, Claude Code's key parser inconsistently interprets the \^[\r sequence — sometimes as meta+return (→ newline) and sometimes as separate ESC + return (→ submit).
Additional Context
editor.accessibilitySupport: "on"was found to cause a separate issue (Tab key leaking into TUI during Cmd+Shift+Tab). Changing to"auto"fixed that, but did not fix the Shift+Enter inconsistency.- The
\(backslash) + Enter workaround works consistently. - Since behavior varies per session (not per folder or config), this appears to be a race condition or timing issue in the terminal input parser's handling of the ESC (
\^[) prefix for meta key detection.
Expected Behavior
Shift+Enter should consistently insert a newline in all terminal sessions.
Actual Behavior
Shift+Enter inserts a newline in some sessions but submits input in others, with no apparent pattern.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗