shift+enter keybinding for chat:newline not recognized on Windows Terminal

Status Closed — duplicate
Maintainer reply None cached
Activity 4 comments · opened Jul 24, 2026 · closed Aug 15, 2026

Bug Report

Platform: Windows 11 Enterprise
Terminal: Windows Terminal
Claude Code version: latest

Description

The shift+enter keybinding configured for chat:newline does not work in Claude Code when running inside Windows Terminal. The keypress appears to be ignored — Shift+Enter either does nothing or submits the message instead of inserting a newline.

Steps to Reproduce

  1. On Windows, open Windows Terminal
  2. Configure ~/.claude/keybindings.json:

``json
{
"$schema": "https://www.schemastore.org/claude-code-keybindings.json",
"$docs": "https://code.claude.com/docs/en/keybindings",
"bindings": [
{
"context": "Chat",
"bindings": {
"shift+enter": "chat:newline"
}
}
]
}
``

  1. Start Claude Code
  2. Press Shift+Enter in the chat input

Expected Behavior

A newline is inserted into the chat input (same as ctrl+j).

Actual Behavior

The keypress is not handled — no newline is inserted.

Additional Context

  • Windows Terminal does forward Shift+Enter as a distinct keystroke to other terminal applications (confirmed by testing in other TUI apps in the same terminal session)
  • The built-in ctrl+j binding for chat:newline works correctly
  • The /terminal-setup slash command incorrectly reports "Shift+Enter is natively supported in Windows Terminal. No configuration needed." — this is misleading since the issue is on Claude Code's side, not the terminal's

The bug appears to be that Claude Code does not correctly parse or handle the escape sequence that Windows Terminal sends for Shift+Enter.

View original on GitHub ↗

3 Comments

anton-ubi · 1 month ago

Confirming this on Windows 11 (build 26200, version 25H2) + Windows Terminal 1.24.11911.0 + PowerShell 7.

/terminal-setup says Shift+Enter should work, but it still submits instead of adding a newline.

I tried @deganii's Windows Terminal workaround (remapping Shift+Enter to send a newline directly). It does fix Claude
Code, but since that remap applies to the whole terminal, it also broke Shift+Enter in PowerShell: instead of
inserting a new line at the cursor, PSReadLine inserted it above the current line. Had to undo the workaround because
of that.

Using Ctrl+J or Ctrl+Enter for now, but would be great to see this fixed properly so Shift+Enter works without side
effects elsewhere.

HUMORCE · 28 days ago

Install 'Windows Terminal Preview' to temporarily solved this issue, or wait for 1.25 to be released; Of course, this is definitely a bug of /terminal-setup

Inputting your Inputs (better) Windows Terminal now ships with built-in support for Kitty‘s Keyboard protocol, which allows commandline applications to disambiguate keys such as Esc from Ctrl+[ and receive information about which modifiers were pressed. This allows applications to receive Shift+Enter among other things, which should improve your interaction with some modern “agentic” command line tools. https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-25-release/
yasuyuki · 19 days ago

This looks like a duplicate of #77311, which covers the same failure with the root cause
already narrowed down.

Short version of why the keybinding can't work: Windows Terminal sends a bare CR for
both Enter and Shift+Enter, and Claude Code never asks it for anything better — it emits
no win32-input-mode enable (ESC[?9001h) and no kitty keyboard push (CSI > <flags> u).
The Shift state is discarded before the app sees it, so no keybindings.json entry can
match. Confirmed still true in v2.1.224.

On the /terminal-setup misreport you flagged: the cause is that windows-terminal is
listed in the table of terminals assumed to emit CSI-u natively, alongside
Ghostty/Kitty/iTerm2/WezTerm/Warp. That makes supportsShiftEnter() return true, so the
command short-circuits to "no configuration needed" and the UI advertises shift+enter
as the newline hint. Details and the rest of the analysis are in
https://github.com/anthropics/claude-code/issues/77311#issuecomment-5262130898.

Re the WT Preview 1.25 suggestion above: I don't think a terminal upgrade fixes this by
itself. The kitty keyboard protocol is opt-in and v2.1.224 never pushes flags, so the
bytes arriving on stdin shouldn't change. If it does work for you on 1.25, could you say
which Claude Code version you were on? That would mean an enable exists somewhere I
couldn't find.

Suggest consolidating on #77311.

Showing cached comments. Read the full discussion on GitHub ↗