Warp icon indicating copy to clipboard operation
Warp copied to clipboard

Can't get shift+enter to produce new line in Claude Code

Open fratrik opened this issue 7 months ago • 40 comments

Pre-submit Checks

Describe the bug

At the command-line prompt, typing shift+enter produces the new line that I prefer.

However inside claude-code, I can't seem to get it to produce a new line instead of sending the command to claude code. I tried a number of bindkey etc., but there seems to be some other problem.

I've also created an issue in claude, https://github.com/anthropics/claude-code/issues/923

To reproduce

type ls[shift+enter] get a new line

launch claude code: claude

type hello[shift+enter]

get hello sent to the claude app

Expected behavior

I expect it to add a new line instead.

Screenshots, videos, and logs

warp-logs.zip

Operating system (OS)

macOS

Operating system and version

15.4.1

Shell Version

zsh 5.9 (arm64-apple-darwin24.0)

Current Warp version

v0.2025.04.23.08.11.stable_01

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

fratrik avatar May 01 '25 15:05 fratrik

I have same issue on WSL Ubuntu 22.04 LTS and VS Code terminal (running on Windows 10)

Ariloum avatar May 18 '25 23:05 Ariloum

Same issue!

atra-fyndiq avatar May 22 '25 14:05 atra-fyndiq

same issue , WSL Ubuntu and VS Code

Shvan11 avatar May 23 '25 11:05 Shvan11

same issue, WSL Ubuntu, integrated VS Code terminal

Kanezal avatar May 23 '25 18:05 Kanezal

same here - macOS 15.5, zsh 5.9, warp version v0.2025.05.21.08.11.stable_01

Briiick avatar May 25 '25 22:05 Briiick

same issue on warp!

wilsonhou avatar May 26 '25 11:05 wilsonhou

Im having this issue as well on macOS terminal

mjonesjr90 avatar May 31 '25 02:05 mjonesjr90

+1 i'm having the same issue!

DhvanilPatel avatar May 31 '25 19:05 DhvanilPatel

Same issue

chemeris avatar May 31 '25 19:05 chemeris

+1 same issue, if that would help :)

SeMmyT avatar May 31 '25 21:05 SeMmyT

Guess what, same issue :)

Cybonto avatar May 31 '25 21:05 Cybonto

Image The keyboard manager powertoy is an easy fix. @Cybonto @chemeris @DhvanilPatel @mjonesjr90 FYI in case :)

SeMmyT avatar May 31 '25 21:05 SeMmyT

@SeMmyT Do you mean you found out how to fix this by changing config? If so, could you please enlighten us? 🙏🏻

tobiasmuehl avatar Jun 01 '25 04:06 tobiasmuehl

same issue, macos 14.4.1 + iterm2 3.4.22

kevinsqi avatar Jun 01 '25 05:06 kevinsqi

@SeMmyT Do you mean you found out how to fix this by changing config? If so, could you please enlighten us? 🙏🏻

a windows powertoy "keyboard manager" - but it's window detections sucks for some reason, had the hotkey swap not triggered multiple times.

SeMmyT avatar Jun 01 '25 08:06 SeMmyT

Works for me just fine...

  • macOS Sequoia 15.5 arm64
  • v0.2025.05.28.08.11.stable_02
  • v0.2025.05.28.08.11.preview_05

Image

TropicTechie avatar Jun 02 '25 14:06 TropicTechie

It's within the Claude Code command claude, not the AI interface of Warp.

https://github.com/user-attachments/assets/567efbb2-87f1-41e1-88db-98d1508014e8

fratrik avatar Jun 02 '25 14:06 fratrik

I found a workaround apparently, in claude you can use +Enter to make a new line. Works for me in Warp + tmux + claude. A bit less convenient than Shift+Enter but bearable.

chemeris avatar Jun 02 '25 16:06 chemeris

As another workaround, you can escape the enter key via \<enter> - however it'd be nice if this bug could still be fixed

hamlim avatar Jun 02 '25 16:06 hamlim

It's within the Claude Code command claude, not the AI interface of Warp.

Screen.Recording.2025-06-02.at.10.14.45.mov

Thank you for taking time to record a video :).

I've tested in regular powershell terminal, cursor and vscode (powershell terminal as well), in Windows 11 and it seems shift+enter for entering new command and ctrl+enter for new line are the expected hotkeys, but only Cursor has an in-build workaround - and on pressing shift+enter inserts \ and makes a new line, while ctrl+enter sends the chat.

Is it possible to add the option to add similar workaround in future Warp's updates? ^^.

SeMmyT avatar Jun 02 '25 16:06 SeMmyT

From the Claude docs directly:

You have several options for entering linebreaks into Claude Code:

  • Quick escape: Type \ followed by Enter to create a newline
  • Keyboard shortcut: Press Option+Enter (Meta+Enter) with proper configuration

https://docs.anthropic.com/en/docs/claude-code/cli-usage#line-breaks-in-terminal https://docs.anthropic.com/en/docs/claude-code/settings#line-breaks

TropicTechie avatar Jun 03 '25 15:06 TropicTechie

@warpdotdev-devx should work with Anthropic to get a workaround similar to iTerm2:

Tip for iTerm2 and VSCode users: Run /terminal-setup within Claude Code to automatically configure Shift+Enter as a more intuitive alternative.

TropicTechie avatar Jun 03 '25 15:06 TropicTechie

I can't get Shift+Enter working. Ctrl+Enter also does not work. Both send command to the Claude like Enter alone does. Even after running /terminal-setup (which throws an error if something is already taking this shortcut, which I removed and tried again with no error this time but it still did nothing to help.

RobertDudus avatar Jun 04 '25 13:06 RobertDudus

Option-enter does not work for me. Perhaps Warp is capturing the Option and not passing it on?

https://github.com/user-attachments/assets/7d09ea05-0bdc-440d-b612-5cd3e8f75bce

fratrik avatar Jun 04 '25 14:06 fratrik

To be clear, I'm entirely open to the idea that I've misconfigured something, but I've looked around and can't figure out what it could be.

fratrik avatar Jun 04 '25 14:06 fratrik

+1

j-standfast avatar Jun 06 '25 18:06 j-standfast

@warpdotdev-devx should work with Anthropic to get a workaround similar to iTerm2:

Tip for iTerm2 and VSCode users: Run /terminal-setup within Claude Code to automatically configure Shift+Enter as a more intuitive alternative.

Life saver I owe you one lol works perfectly

diegonavarro96 avatar Jun 06 '25 21:06 diegonavarro96

https://github.com/user-attachments/assets/a39adba3-03a9-4aaa-b1ec-61cf57a98bc1

life saver

diegonavarro96 avatar Jun 06 '25 21:06 diegonavarro96

I have this issue as well (editing becuase it was fixed with /terminal-setup in claude code) thanks beautiful people

Metzpapa avatar Jun 09 '25 01:06 Metzpapa

@warpdotdev-devx should work with Anthropic to get a workaround similar to iTerm2:

Tip for iTerm2 and VSCode users: Run /terminal-setup within Claude Code to automatically configure Shift+Enter as a more intuitive alternative.

As per usual, the answer is somewhere buried deep in these comments. /terminal-setup does the trick. Thanks @warpdotdev-devx!

dr2050 avatar Jun 09 '25 14:06 dr2050