claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Ctrl+Enter for newlines conflicts with standard app conventions - request customizable shortcuts

Open shorn opened this issue 1 year ago • 33 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [x] Other: Claude Code CLI
  • Claude CLI version: 1.0.67 (Claude Code)
  • Operating System: Windows 10
  • Terminal: Windows Terminal

Feature Request Description

Request ability to customize keyboard shortcuts for newline insertion in Claude Code interactive mode. Currently, Ctrl+Enter is used to add newlines, but this conflicts with standard application conventions where Ctrl+Enter is typically used for "submit" functionality.

Current Behavior

  1. Open Claude Code in interactive mode
  2. Type a message
  3. Press Ctrl+Enter to add a newline
  4. Press Enter to submit the message

Requested Behavior

Allow users to configure alternative keyboard shortcuts for newline insertion, such as:

  • Shift+Enter for newlines (matching standard conventions)
  • Enter for submission
  • Or allow users to swap the current Enter/Ctrl+Enter behavior

Problem Statement

The current Ctrl+Enter for newlines goes against established conventions in most applications where Ctrl+Enter means "submit" (email clients, chat applications, web forms, etc.). This creates muscle memory conflicts that cause:

  1. Accidental submissions in other tools: Users trained on Claude Code's shortcuts inadvertently send incomplete emails, messages, or forms in other applications when attempting to add newlines
  2. Workflow disruption: Constant mental context switching between Claude Code's unique shortcuts and standard application behavior
  3. User safety issues: Mis-sent emails and incomplete form submissions can have professional consequences

Additional Context

  • The \ + Enter workaround exists but is non-standard and unintuitive
  • /terminal-setup only works for iTerm2 and VS Code, not Windows Terminal
  • This affects user productivity and creates potential for embarrassing mistakes in professional communications
  • Standard convention across most applications (including claude web): Enter = submit, Shift+Enter = newline

shorn avatar Aug 04 '25 00:08 shorn

i agree this is very native for common users to have Shift+Enter hotkey for newlines

fsjn avatar Aug 04 '25 00:08 fsjn

It's really surprising to me how quickly ctrl+enter for newlines in claude-code entered my muscle memory for "next line"(I guess because i micro-manage claude a lot. Though I don't even need to put newlines in - claude knows what I mean! i just can't bring myself to cram my messages it all on one line. It's resulted in me sending quite a few confusing emails to folks lately, with literally only a single line of content because gmail takes ctrl-enter to mean "send it now".

shorn avatar Aug 04 '25 01:08 shorn

Strongly agree, shift+enter is the standard convention and this inconsistency is leading me to very often send prompts to claude before they're complete. Please consider making a toggle in the settings!!

nrgbistro avatar Aug 07 '25 12:08 nrgbistro

Seriously. My number one pain point using Claude Code is this.

Jinkxed avatar Aug 08 '25 00:08 Jinkxed

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2335
  2. https://github.com/anthropics/claude-code/issues/2054
  3. https://github.com/anthropics/claude-code/issues/1758

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 08 '25 20:08 github-actions[bot]

I prevented auto-close because the 1. and 2. are about the behavior of Enter. 3. seems to be about supporting Shift+Enter in some terminals where it doesn't work, or the submitter doesn't like the implementation, not sure?

With regard to this use, c-c works fine with Shift+Enter, it just does the same thing as Enter already does in my env (windows terminal).

That said, it's clear from the various issues raised about how all these keys work (there's more than just those 3 linked above), that maybe c-c could benefit from some kind of UX pass with regard to input processing. For example, for myself, I agree with the people who submitted 1. and 2. - my prompts are always longer than one line. But on the other hand, i find myself very frequently writing prompts in a scratch file or a prompt file, because if I'm writing a long multi-line prompt at the CLI, an accidental press of ESC will wipe out everything I typed.

Happy for this issue to be closed if that's already happening.

shorn avatar Aug 08 '25 23:08 shorn

Am also supporting this issue

When using Claude in Android Studio’s terminal, Shift + Enter works for inserting a new line. However, in PyCharm’s terminal, Shift + Enter and Ctrl + Enter both execute the command instead of creating a new line.

Currently, the only way to insert a new line is by using \ + Enter, which is inconvenient. Having to remember different shortcuts between IDEs is a pain point and both are JetBrains IDEs

Please add an option to customize the “new line” shortcut in the terminal

muammil avatar Aug 12 '25 04:08 muammil

If you have PowerToys installed, you may try remapping with Keyboard Manager as a workaround.

Image

tzengshinfu avatar Aug 20 '25 08:08 tzengshinfu

We need the Enter key configuration feature, like Slack has. https://slack.com/help/articles/115005523006-Set-your-Enter-key-preference

taniko avatar Oct 04 '25 09:10 taniko

I'd also benefit from configurable keybindings, though with a different preference. Coming from web-based chat apps (Slack, Discord, ChatGPT), I'd like:

  • Enter → newline
  • Ctrl+Enter → submit

This is the opposite of the current behavior, but matches the pattern used in most modern chat applications where Enter allows you to compose multi-line messages naturally.

My use case: Running Claude Code in tmux, where Shift/Option modifiers can be awkward. The \ + Enter workaround breaks muscle memory from other chat interfaces.

A configurable setting like this would satisfy both our needs:

  {
    "keybindings": {
      "newline": "Enter",      // or "Shift+Enter", "Ctrl+Enter", etc.
      "send": "Ctrl+Enter"     // or "Enter"
    }
  }

+1 for making this configurable rather than changing the defaults!

etirta avatar Oct 29 '25 20:10 etirta

I absolutely agree with @etirta . This is why I moved from Windsurf to Claude Code, because Windsurf don't listen to the users since month about this topic. I hope Anthropics will do and provide us a solution.

kinglycodes avatar Oct 30 '25 15:10 kinglycodes

When writing in Japanese, we need to press Enter after each word to confirm the input, which makes unintended submissions more likely under the current design. I sincerely hope that supporting Ctrl (or Cmd) + Enter for submitting messages will be considered.

boke0 avatar Oct 31 '25 16:10 boke0

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 10 '25 10:12 github-actions[bot]

This issue is still very much a problem and occurring.

jaroslawjanas avatar Dec 14 '25 02:12 jaroslawjanas

This drives me crazy and means constantly truncated prompts mis-sent in Claude Code, hampering usability.

Storyyeller avatar Jan 06 '26 02:01 Storyyeller

The defaults are ridiculous. I pretty much never have single line prompts. Having this be configurable is a must.

That this is also an issue when in insert mode with vim bindings is even more egregious.

alex-hunt-materialize avatar Jan 07 '26 19:01 alex-hunt-materialize

Maybe maybe? https://github.com/anthropics/claude-code/commit/870624fc1581a70590e382f263e2972b3f1e56f5#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR9

Jinkxed avatar Jan 07 '26 23:01 Jinkxed

@Jinkxed If I'm reading the changelog correctly, that sounds like an unrelated improvement, that we won't need to inject configuration into our terminal configs to get the current Shift+Enter behavior of inserting a newline. This issue is about being able to reconfigure the keyboard shortcuts to be able to map other combinations, such as having Enter be a newline and Shift+Enter submit the prompt (ie: the opposite of what we have now).

alex-hunt-materialize avatar Jan 08 '26 09:01 alex-hunt-materialize

Reconfiguration of the newline keyboard shortcut would be optimal, because some people on MacOS got used to Option+Enter, and don't like the current Shift+Enter https://github.com/anthropics/claude-code/issues/16764.

As a side note, I hope this issue won't get closed soon due to "60 days of inactivity". The autoclose bot is currently going around and closing issues that contain active human dicussions https://github.com/anthropics/claude-code/issues/16497.

marcindulak avatar Jan 08 '26 16:01 marcindulak

+1(Keep this post active)

tzengshinfu avatar Jan 16 '26 01:01 tzengshinfu