Please enable modifyOtherKeys in xterm to allow Ctrl-Enter and Shift-Enter

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 3, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Like many users, I keep submitting incomplete messages by hitting Enter by
accident in an xterm. Enter is both the most-pressed key while composing and
the irreversible "send" action, which is a bad combination.

Proposed Solution

I have worked around it by rebinding in ~/.claude/keybindings.json:

"enter": "chat:newline",
"ctrl+x ctrl+s": "chat:submit"

That is fine for an Emacs user like me, but the natural bindings would be
Ctrl-Enter or Shift-Enter. Those cannot work today: in a terminal, Ctrl-Enter
and Shift-Enter send a plain CR, indistinguishable from Enter. (The
keybindings docs acknowledge this for ctrl+m.)

xterm can distinguish them, but only if the application asks it to, by
enabling modifyOtherKeys — send CSI > 4 ; 2 m on startup and CSI > 4 ; 0 m on
exit. Modified keys then arrive as distinct sequences (CSI 27;5;13~, or CSI
13;5u with formatOtherKeys=1). Emacs does exactly this, which is why
Ctrl-Enter works there.

The wishlist item: enable modifyOtherKeys on xterm-family terminals and parse
the resulting sequences, so ctrl+enter, shift+enter (and ctrl+m) become
bindable.

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗