Keyboard keybinds configuration not working - input_newline: shift+enter ignored #8440

Open
opened 2026-02-16 18:09:58 -05:00 by yindo · 3 comments
Owner

Originally created by @DaveW001 on GitHub (Feb 3, 2026).

Originally assigned to: @kommander on GitHub.

Problem Summary

I'm trying to configure OpenCode to use the following AI chat keybindings:

  • Enter = Submit message
  • Shift+Enter = Insert new line

However, despite configuring , Shift+Enter still submits the message instead of inserting a new line. This behavior is consistent across multiple terminal environments.


Environment

  • OpenCode Version: 1.1.49
  • OS: Windows 11 Pro
  • Terminals Tested:
    • Google Antigravity
    • Warp Terminal
    • Windows Terminal (PowerShell)

Configuration Applied

File Location: %APPDATA%\opencode\opencode.json (e.g., C:\Users\[USER]\AppData\Roaming\opencode\opencode.json)
Configuration Content:

{
  "keybinds": {
    "input_newline": "shift+enter",
    "input_submit": "enter"
  }
}

What We've Tried

  1. Located config file - Found at %APPDATA%\opencode\opencode.json
  2. Created backup - opencode.json.backup
  3. Applied configuration - Added both input_newline and input_submit explicitly
  4. Restarted OpenCode - Full restart between tests
  5. Tested multiple terminals - Same behavior across all terminals
  6. Validated JSON - Configuration is valid JSON

Test Results

Terminal Enter Shift+Enter Ctrl+Enter Alt+Enter
Google Antigravity Submits Submits Submits New line
Warp Terminal Submits Submits New line ✓ Creates 'nter' text
Windows Terminal (PowerShell) Submits Submits New line ✓ Maximize window

Expected: Shift+Enter should insert a new line
Actual: Shift+Enter submits the message (same as Enter)

Notes:

  • Ctrl+Enter behavior varies by terminal (submits in Antigravity, new line in Warp and Windows Terminal)
  • Alt+Enter in Google Antigravity creates the text 'nter' in the message box instead of inserting a newline

Documentation References

Based on the OpenCode documentation and GitHub repository research, the configuration object should support:

    • Key to insert a new line in the input
    • Key to submit the message

We've tried the following key name formats:

  • (current)
  • (alternative, not yet tested)
  • (Emacs-style, not yet tested)

Questions

  1. Are these the correct keybind names? The documentation mentions configuration but doesn't specify the exact key names for and .

  2. Is there a different key name format we should use? For example:

    • instead of ?
    • (capitalized)?
    • (Emacs-style)?
  3. Is this a known issue with version 1.1.49? The configuration appears to be ignored entirely.

  4. Where can we find the complete list of supported keybind actions and key names? The current documentation doesn't seem to cover this in detail.


Steps to Reproduce

  1. Open (create if doesn't exist)
  2. Add the keybinds configuration shown above
  3. Save and close OpenCode completely
  4. Reopen OpenCode in any terminal
  5. Type text in the chat input
  6. Press Shift+Enter
  7. Observe: Message submits instead of inserting new line

Additional Context

  • We've confirmed the configuration file is being read (JSON syntax errors cause OpenCode to fail to start)
  • The issue persists across terminal environments, suggesting it's not terminal-specific
  • We're willing to test alternative key name formats or provide logs if helpful

**Please let us know if there's additional information we can provide or debugging steps we should try. Thank you!

Originally created by @DaveW001 on GitHub (Feb 3, 2026). Originally assigned to: @kommander on GitHub. ### **Problem Summary** I'm trying to configure OpenCode to use the following AI chat keybindings: - **Enter** = Submit message - **Shift+Enter** = Insert new line However, despite configuring , **Shift+Enter still submits the message** instead of inserting a new line. This behavior is consistent across multiple terminal environments. --- ### **Environment** - **OpenCode Version:** 1.1.49 - **OS:** Windows 11 Pro - **Terminals Tested:** - Google Antigravity - Warp Terminal - Windows Terminal (PowerShell) --- ### **Configuration Applied** **File Location:** `%APPDATA%\opencode\opencode.json` (e.g., `C:\Users\[USER]\AppData\Roaming\opencode\opencode.json`) **Configuration Content:** ```json { "keybinds": { "input_newline": "shift+enter", "input_submit": "enter" } } ``` --- ### **What We've Tried** 1. ✅ **Located config file** - Found at `%APPDATA%\opencode\opencode.json` 2. ✅ **Created backup** - `opencode.json.backup` 3. ✅ **Applied configuration** - Added both `input_newline` and `input_submit` explicitly 4. ✅ **Restarted OpenCode** - Full restart between tests 5. ✅ **Tested multiple terminals** - Same behavior across all terminals 6. ✅ **Validated JSON** - Configuration is valid JSON --- ### **Test Results** | Terminal | Enter | Shift+Enter | Ctrl+Enter | Alt+Enter | | ----------------------------- | ------- | ----------- | ------------- | ---------------------- | | Google Antigravity | Submits | **Submits** ❌ | **Submits** ❌ | New line | | Warp Terminal | Submits | **Submits** ❌ | New line ✓ | Creates 'nter' text | | Windows Terminal (PowerShell) | Submits | **Submits** ❌ | New line ✓ | Maximize window | **Expected:** Shift+Enter should insert a new line **Actual:** Shift+Enter submits the message (same as Enter) **Notes:** - Ctrl+Enter behavior varies by terminal (submits in Antigravity, new line in Warp and Windows Terminal) - Alt+Enter in Google Antigravity creates the text 'nter' in the message box instead of inserting a newline --- ### **Documentation References** Based on the [OpenCode documentation](https://opencode.ai/docs) and GitHub repository research, the configuration object should support: - - Key to insert a new line in the input - - Key to submit the message We've tried the following key name formats: - (current) - (alternative, not yet tested) - (Emacs-style, not yet tested) --- ### **Questions** 1. **Are these the correct keybind names?** The documentation mentions configuration but doesn't specify the exact key names for and . 2. **Is there a different key name format we should use?** For example: - instead of ? - (capitalized)? - (Emacs-style)? 3. **Is this a known issue with version 1.1.49?** The configuration appears to be ignored entirely. 4. **Where can we find the complete list of supported keybind actions and key names?** The current documentation doesn't seem to cover this in detail. --- ### **Steps to Reproduce** 1. Open (create if doesn't exist) 2. Add the keybinds configuration shown above 3. Save and close OpenCode completely 4. Reopen OpenCode in any terminal 5. Type text in the chat input 6. Press Shift+Enter 7. **Observe:** Message submits instead of inserting new line --- ### **Additional Context** - We've confirmed the configuration file is being read (JSON syntax errors cause OpenCode to fail to start) - The issue persists across terminal environments, suggesting it's not terminal-specific - We're willing to test alternative key name formats or provide logs if helpful --- **Please let us know if there's additional information we can provide or debugging steps we should try. Thank you!
yindo added the windowsopentui labels 2026-02-16 18:09:58 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11077: keybinds configuration is invalid - reports keybind configuration being ignored
  • #11898: Is there any way to use enter to send newline, and ctrl+enter to send message - directly related feature request for newline vs submit keybinds
  • #4997: Keybinds - pinned issue covering multiline input (shift+enter, ctrl+enter) and custom keybind remapping not working

For keybind-related issues, please also check our pinned keybinds documentation: #4997

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 3, 2026): This issue might be a duplicate of existing issues. Please check: - #11077: keybinds configuration is invalid - reports keybind configuration being ignored - #11898: Is there any way to use enter to send newline, and ctrl+enter to send message - directly related feature request for newline vs submit keybinds - #4997: Keybinds - pinned issue covering multiline input (shift+enter, ctrl+enter) and custom keybind remapping not working For keybind-related issues, please also check our pinned keybinds documentation: #4997 Feel free to ignore if none of these address your specific case.
Author
Owner

@DaveW001 commented on GitHub (Feb 3, 2026):

Note: I reviewed potential duplicates. They overlap, but are not the same. In my case, I am trying to use the opencode jscon to remap keybindings. The open threads/issues appear to not be related to keybinding mappings.

@DaveW001 commented on GitHub (Feb 3, 2026): Note: I reviewed potential duplicates. They overlap, but are not the same. In my case, I am trying to use the opencode jscon to remap keybindings. The open threads/issues appear to not be related to keybinding mappings.
Author
Owner

@rekram1-node commented on GitHub (Feb 3, 2026):

Some terminals don't support it out of the box because they don't send anything we can key off of. You will need to modify your terminal settings to send correct modifiers so that opencode has some way to distinguish between enter and shift enter.

We have examples in our keybinding docs for windows terminal.

@rekram1-node commented on GitHub (Feb 3, 2026): Some terminals don't support it out of the box because they don't send anything we can key off of. You will need to modify your terminal settings to send correct modifiers so that opencode has some way to distinguish between enter and shift enter. We have examples in our keybinding docs for windows terminal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8440