Enable shift+enter in Claude Code

This is yet another "thing I will forget, so I'm writing a note here" post.

I've been used to using Claude Code inside the IntelliJ plugin.  That plugin is very basic and still in beta, but it works well enough.  All it really does is run Claude Code in the integrated terminal, provide the current file as context, and show changes in the integrated diff viewer.  But it also pre-configures the setting to allow you to press shift+enter in the Claud Code to enter a newline.

If you fire up Claude Code in a Windows Terminal session, this does not work.  To enter a newline, you have to type a backslash followed by enter, which sort of makes sense, but is annoying and unintuitive.  There is a /terminal-setup command, but that also doesn't work in Windows Terminal.  Apparently Anthropic hasn't gotten around to implementing that yet.

Fortunately, there is a work-around.  You can manually add the key bindings to your Windows Terminal configuration.  

"actions": [
  {
    "command": {
      "action": "sendInput",
      "input": "\u000A"
    },
    "id": "User.sendLF"
  }
],
"keybindings": [
  {
    "id": "User.sendLF",
    "keys": "shift+enter"
  }
]

That's what Claude spit out from a scape of Github, anyway.  I originally got it from a Redit post that said essentially the same thing, but now I can't find it.  Either way, it seems to work just fine.

You can reply to this entry by leaving a comment below. This entry accepts Pingbacks from other blogs. You can follow comments on this entry by subscribing to the RSS feed.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.