Skip to content

Shift+Enter intercepted, not forwarded to PTY (breaks Kitty keyboard protocol) #2970

Closed as duplicate

Description

@marvtub

Shift+Enter is intercepted and not forwarded to the PTY

Summary

Superset's terminal intercepts Shift+Enter via attachCustomKeyEventHandler and prevents it from reaching the PTY. This breaks terminal applications that rely on the Kitty keyboard protocol to distinguish Shift+Enter from plain Enter — notably pi, Claude Code, and other CLI tools that use Shift+Enter for multi-line input.

Expected behavior

When a terminal application has enabled the Kitty keyboard protocol (via CSI > 1 u), Shift+Enter should be forwarded to the PTY as the CSI u sequence \x1b[13;2u, allowing the application to distinguish it from plain Enter.

Actual behavior

Shift+Enter is unconditionally swallowed by Superset's custom key event handler:

// helpers.ts ~line 536
const isShiftEnter =
    event.key === "Enter" &&
    event.shiftKey &&
    !event.metaKey &&
    !event.ctrlKey &&
    !event.altKey;

if (isShiftEnter) {
    if (event.type === "keydown" && options.onShiftEnter) {
        event.preventDefault();
        options.onShiftEnter();
    }
    return false;  // ← prevents xterm.js from sending anything to the PTY
}

The return false prevents xterm.js from processing the key, so the Kitty protocol response is never generated regardless of whether the application requested it.

Affected applications

  • pi — uses Shift+Enter for new line in its TUI editor
  • Claude Code — uses Shift+Enter for multi-line input
  • Any terminal application using the Kitty keyboard protocol

Suggested fix

Check whether the Kitty keyboard protocol is active before intercepting. xterm.js tracks this internally. When the protocol is enabled, Shift+Enter should pass through to the PTY so xterm.js can encode it as \x1b[13;2u.

A simpler alternative: add a per-terminal or global setting to disable the Shift+Enter interception, e.g.:

{
  "terminal.shiftEnterBehavior": "passthrough" | "superset"
}

Workaround

Users can rebind the new-line action in pi to Ctrl+J via ~/.pi/agent/keybindings.json:

{
  "tui.input.newLine": ["shift+enter", "ctrl+j"]
}

Environment

  • Superset: latest
  • macOS
  • pi / Claude Code running inside Superset terminal

Activity

  1. added a commit that references this issue on Mar 28, 2026
  2. sarthaksrinivas commented on Apr 6, 2026

    @sarthaksrinivas

    I run pi inside Superset as my daily driver. Shift+Enter is the default keybinding for inserting a new line in your TUI editor (tui.input.newLine), and since Superset intercepts it before it reaches the PTY, multi-line input is completely broken (every Shift+Enter submits the message instead).

    I have confirmed that pi requests the Kitty keyboard protocol on startup via CSI > 1 u, so the approach in #2971 (checking kittyKeyboard.flags before intercepting) would fix this for my workflow.

    Would love to see #2971 merged — happy to test a build if that would help move it forward.

  3. sarthaksrinivas commented on Apr 8, 2026

    @sarthaksrinivas

    #3251

    @marvtub does this solve your issue?

  4. Kitenite commented on May 6, 2026

    @Kitenite
    Member

    Related reports (cross-referenced during issue triage — same area, may or may not share a root cause):

  5. Kitenite commented on Jul 11, 2026

    @Kitenite
    Member

    Closing as a duplicate of #5604, the consolidated tracker for stale terminal-input issues from the July 2026 stale-issue sweep (no activity since 2026-06-01). If this still applies on a current build, comment on #5604 and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions