Multi-line prompts in Claude Code and Windows Terminal

July 23, 2026

If you use Claude Code inside Windows Terminal, you’ve probably hit this: you want to add a new line to your prompt with Shift+Enter, but instead the message just gets sent. Annoying, right? You end up cramming everything onto one long line like it’s 1995.

The good news: it’s a two-minute fix. You just have to tell Windows Terminal to send a special key sequence when you press Shift+Enter, and Claude Code will happily pick it up.

Why this happens

By default, Windows Terminal doesn’t have a clean way to tell an app “hey, the user pressed Shift+Enter, not just plain Enter.” Both look the same to the app underneath. So Claude Code sees a normal Enter and does what Enter usually does — submits your message.

To fix it, we lean on something called the CSI u key encoding (also known as the Kitty keyboard protocol). It’s basically a modern way for the terminal to describe key presses in more detail, including which modifier keys (Shift, Alt, Ctrl) were held down. When Claude Code receives that richer info, it knows the difference and inserts a new line instead of sending.

The fix

Open your Windows Terminal settings JSON file:

  1. Open Windows Terminal
  2. Press Ctrl+, to open Settings (or click the down-arrow (˅) in the tab bar and choose Settings if the shortcut doesn’t do anything on your keyboard)
  3. In the Settings tab, click Open JSON file in the bottom-left corner

Now find the "actions" section and add this action:

{
    "command": {
        "action": "sendInput",
        "input": ""
    },
    "id": "User.sendInput.ShiftEnter"
}

Then, in the "keybindings" section, bind it to Shift+Enter:

{
    "id": "User.sendInput.ShiftEnter",
    "keys": "shift+enter"
}

Save the file, and that’s it. No restart needed — it usually kicks in right away.

What that weird  means

Don’t worry, you don’t need to memorize it, but here’s the quick decoder:

  •  is the escape character (ESC)
  • 13 is the code for the Enter key
  • 2 is the modifier for Shift
  • u marks it as a CSI u sequence

So the whole thing literally says: “Enter key + Shift.” Clean and unambiguous.

Bonus: Alt+Enter too

While you’re in there, you can add the same trick for Alt+Enter (handy in some apps). Just change the modifier number from 2 to 3:

{
    "command": {
        "action": "sendInput",
        "input": ""
    },
    "id": "User.sendInput.AltEnter"
}

And bind it to "alt+enter" the same way.

The full thing to copy

Don’t feel like piecing it together? Here’s everything in one go. The "actions" array holds both key sequences, and the "keybindings" array wires them up to Shift+Enter and Alt+Enter:

{
    "actions": [
        {
            "command": {
                "action": "sendInput",
                "input": ""
            },
            "id": "User.sendInput.ShiftEnter"
        },
        {
            "command": {
                "action": "sendInput",
                "input": ""
            },
            "id": "User.sendInput.AltEnter"
        }
    ],
    "keybindings": [
        {
            "id": "User.sendInput.ShiftEnter",
            "keys": "shift+enter"
        },
        {
            "id": "User.sendInput.AltEnter",
            "keys": "alt+enter"
        }
    ]
}

If you already have "actions" or "keybindings" sections in your settings, just drop these entries inside the existing arrays instead of pasting the whole block — otherwise you’ll end up with duplicate keys and Windows Terminal will complain.

Wrapping up

That’s really all there is to it. One small tweak to your Windows Terminal config and suddenly writing multi-line prompts in Claude Code feels natural again. Small change, big quality-of-life boost.

Happy prompting!