warp icon indicating copy to clipboard operation
warp copied to clipboard

Feature: Allow custom keybindings to send raw hex codes / OpenCode SHIFT+ENTER Fix.

Open mynameistito opened this issue 10 months ago • 25 comments

Pre-submit Checks

Describe the solution you'd like?

Describe the solution you'd like?

I would like the ability to map Shift+Enter (and other keys) to send specific hex codes / escape sequences (e.g., 0x1b 0x0d or \033OM) to the running terminal process, or for the issue to be resolved without the need to custom map it.

Why is this needed?

I am using Opencode, an AI coding agent CLI. In Opencode, Shift+Enter is used to create a new line in the prompt window without submitting the message.

Because Warp intercepts Shift+Enter to handle its own input editor, the keystroke never reaches the Opencode process, or it submits the command prematurely.

Other terminals (like iTerm2 or Alacritty) allow remapping Shift+Enter to send raw hex codes, which fixes this compatibility issue. Warp currently lacks a "Send Hex Code" action in the Keyboard Shortcuts settings.

Steps to reproduce

  1. Install Opencode (curl -fsSL https://opencode.ai/install | bash or bun add -g opencode-ai).
  2. Run opencode in Warp.
  3. Type a prompt and press Shift+Enter to add a new line.
  4. Result: Warp acts on the key (often submitting the command) instead of passing the new line signal to the Opencode TUI.

Additional Context

Opencode documentation recommends remapping Shift+Enter for compatibility on Termina: https://opencode.ai/docs/keybinds/#shiftenter

Currently, the only workaround in Warp is to use Ctrl+J, which disrupts muscle memory.

Operating system (OS)

Windows

How important is this feature to you?

5 (Can't work without it!)

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

None

mynameistito avatar Jan 17 '26 23:01 mynameistito

Related Issues: https://github.com/anomalyco/opencode/issues/8038 https://github.com/anomalyco/opencode/issues/4997

mynameistito avatar Jan 17 '26 23:01 mynameistito

It's disgusting to hijack such action. Please don't change universal behaviors.

fangwangme avatar Jan 19 '26 08:01 fangwangme

facing the same issue and +1 for a fix. (on MacOS)

miankhalid avatar Jan 19 '26 10:01 miankhalid

facing the same issue and +1 for a fix.

Glad to see it's not an isolated issue!

mynameistito avatar Jan 19 '26 12:01 mynameistito

ctrl + j is the way on unix based systems

yesacarlosm avatar Jan 19 '26 23:01 yesacarlosm

Same in my Warp. Claude Code handles it well out of the box, though. Btw, input_delete_line also doesn't work in Warp (on MacOS)

m4ttyk avatar Jan 24 '26 16:01 m4ttyk

Any way to get this fixed? will likely have to stop using Warp as a result

jamesblackwell avatar Jan 27 '26 06:01 jamesblackwell

Any way to get this fixed? will likely have to stop using Warp as a result

Quick fix, not to my knowledge. I tried exploring my options with different terminals and unfortnately Warp seemed like the most polished one. Even, tho I don't touch any of the AI features.

Raising your voice in their Discord: https://discord.com/invite/warpdotdev or Slack which I think is accessable via the Terminal, might also assist. I've reached out in both places and haven't heard anything yet, to my knowledge.

edit: added discord and slack mentions

mynameistito avatar Jan 27 '26 06:01 mynameistito

I tried to get any of the meta+return to work by hacking the opencode config key binds AND the Warp config Key bindings to use the same thing or different things etc. But nothing worked that I tried (cmd+, option+ etc) .. Just FYI. Would be nice to have a generic solution to pick the version of meta+return / enter wanted for a newline to be passed..

tl-sjmcdowall avatar Feb 02 '26 19:02 tl-sjmcdowall

Huge news regarding this issue.

"This is tracked and will be addressed soon!"

Warp Eng on Slack

mynameistito avatar Feb 03 '26 10:02 mynameistito

Hi all, thanks for your patience. The latest version of Warp (v0.2026.02.04.08.20.stable_02) now has support for the Kitty keyboard protocol, which should address this issue. I'm going to close this out but please file an issue if you see any bugs. Thanks!

alokedesai avatar Feb 06 '26 03:02 alokedesai

it works!! just tested Shift + Return on mac, thanks team! 🤜 🤛

miankhalid avatar Feb 06 '26 05:02 miankhalid

Doesn't seem to work on Windows, unless I'm doing something wrong lol

mynameistito avatar Feb 06 '26 06:02 mynameistito

it works!! just tested Shift + Return on mac, thanks team! 🤜 🤛

Can you please explain how you do it ? still not able to work i configured both WARP and Opencode but no luck

amartinawi avatar Feb 08 '26 17:02 amartinawi

Hi all, unfortunately we had to roll this back due to it regressing some pretty core neovim flows. I'll ping back as soon as it's rolled forward.

alokedesai avatar Feb 08 '26 18:02 alokedesai

how can I rollback to the version v0.2026.02.04.08.20.stable_02 ? anyone help?

cometlj avatar Feb 09 '26 02:02 cometlj

I managed to get the download link, the shift+enter-> insert the newline func comes back!

cometlj avatar Feb 11 '26 16:02 cometlj

Very frustrating, what's the plan to add the shift+enter back?

soundstep avatar Feb 20 '26 10:02 soundstep

Very frustrating, what's the plan to add the shift+enter back?

can use the shift+enter in version v0.2026.02.04.08.20.stable_02, you can try

cometlj avatar Feb 20 '26 16:02 cometlj

I just ended up using Hammerspoon to map the shortcut I needed to ⌃+j when my terminal was focused.

chipit24 avatar Feb 20 '26 18:02 chipit24