# Add Shift+Enter to OpenCode in Windows Terminal

**Date:** 2026-05-11  
**Author:** Kees C. Bakker  
**Categories:** Automation  
**Original:** https://keestalkstech.com/adding-shiftenter-for-opencode-on-windows-terminal/

![Add Shift+Enter to OpenCode in Windows Terminal](https://keestalkstech.com/wp-content/uploads/2026/05/martin-garrido-cVUPic1cbd4-unsplash.jpg)

---

The [open source AI coding agent Open Code](https://opencode.ai/) is becoming my go-to editor for AI agents. What's not to love? I can add both OpenAI and GitHub Copilot as providers. Working in the terminal can be a bit different from working in a web browser, especially when inserting new lines. In Windows Terminal, I have to press Ctrl+Enter for a newline. Let's face it: it's just not in my muscle memory. So what can we do to make Shift+Enter a reality?

Don't want to configure it yourself? Let AI do it for you with this prompt: Please read https://keestalkstech.com/adding-shiftenter-for-opencode-on-windows-terminal.md and add the shift+enter feature to the settings of my Windows Terminal.

## Kitty Keyboard Protocol

We are going to use the [kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) to configure the Shift+Enter. To be honest, I had no clue what the kitty keyboard protocol was, but [Windows Terminal has support for it](https://github.com/microsoft/terminal/pull/19817). According to the developer, it solves all sorts of problems with modifiers (like Shift, in our case).

## Locate your settings file

Windows Terminal has a *settings* file which holds your settings, which can be opened in your favorite editor:

```ps
code "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
```

## Add the action

Locate the **actions** node and **add** this command.

There might be other actions, don't overwrite them, just add the 
`{ "command" ... }` section.

```
"actions": 
    [
        {
            "command": 
            {
                "action": "sendInput",
                "input": "\u001b[13;2u"
            },
            "id": "User.sendInput.8882FD6D"
        }
    ]
```

## Add the key binding

Locate the **keybindings** node and **add** this section.

There might be other actions, don't overwrite them, just add the 
`{ "id" ... }` section.

```
"keybindings": 
    [
        {
            "id": "User.sendInput.8882FD6D",
            "keys": "shift+enter"
        }
    ]
```

Bingo, that's it, it should work right away.
