Adding shift+enter for OpenCode on Windows Terminal

The open source AI coding agent Open Code is becoming my goto editor for AI agents. What is not to love? I can add both my Open AI and GitHub Copilot as providers. Working on the terminal can be a bit different then working in a web browser, especially when inserting new lines. On the Windows Terminal I've got to do CTRL+Enter for a newline🤦. Let's face it: it is just not in my system. So what can we do?

We can add the following key binding:

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

This sends the Shift+Enter key sequence in the kitty keyboard protocol format to whatever application is running in your terminal, allowing apps like Neovim that support the protocol to distinguish Shift+Enter from a plain Enter.

To be honest, I had no clue what that kitty keyboard protocol is, but Windows Terminal has support for it. According to the developer, it solves all sorts of problems with modifiers (like shift, in our case).

Let your AI fix the problems

Please read https://keestalkstech.com/adding-shiftenter-for-opencode-on-windows-terminal.md and add the ctrl+enter feature to the settings of my Windows Terminal.

expand_less brightness_auto