Skip to content

input_submit keybind not respected #15755

Closed as not planned
Closed as not planned

Description

@jasonfirkus

Description

Seemingly, no matter what you set it to in tui.json, on enter it will always submit input.

Plugins

@franlol/opencode-md-table-formatter@latest

OpenCode version

1.2.15

Steps to reproduce

  1. Change input_submit keybind in tui.json
  2. Test with that keybind vs enter

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Mar 2, 2026
  2. github-actions commented on Mar 2, 2026

    @github-actions
    Contributor

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

  3. riuoku commented on Apr 5, 2026

    @riuoku

    I'm experiencing the same class of issue with input_word_forward and input_word_backward. Setting them to "none" or overriding them in tui.json has no effect — alt+right/alt+left still trigger word navigation.
    My use case: Running OpenCode in IntelliJ's integrated terminal, where alt+right/alt+left are used for tab switching. OpenCode consumes these keys, preventing IntelliJ from handling them.
    tui.json config:

    {
        "$schema": "https://opencode.ai/tui.json",
        "keybinds": {
            "input_word_forward": "alt+f",
            "input_word_backward": "alt+b"
        }
    }

    Setting input_word_forward to "none" also doesn't work — alt+right still moves the cursor by word.

    Note: Below root cause analysis was performed by an AI assistant:

    Root cause investigation:
    The issue is in @opentui/core's Textarea component (packages/core/src/renderables/Textarea.ts). It has hardcoded default keybindings:

    const defaultTextareaKeybindings: KeyBinding[] = [
      // ...
      { name: "right", meta: true, action: "word-forward" },
      { name: "left", meta: true, action: "word-backward" },
      { name: "right", ctrl: true, action: "word-forward" },
      { name: "left", ctrl: true, action: "word-backward" },
      // ...
    ]

    These defaults are always merged with user-provided keybindings via mergeKeyBindings():

    // In the constructor:
    const mergedBindings = mergeKeyBindings(defaultTextareaKeybindings, this._keyBindings)
    // In the keyBindings setter:
    public set keyBindings(bindings: KeyBinding[]) {
        this._keyBindings = bindings
        const mergedBindings = mergeKeyBindings(defaultTextareaKeybindings, bindings)
        this._keyBindingsMap = buildKeyBindingsMap(mergedBindings, this._keyAliasMap)
    }

    So even though OpenCode's config layer in packages/opencode/src/config/config.ts correctly handles "none" (via Keybind.parse("none") returning []), and textarea-keybindings.ts correctly maps the config to an empty binding list, the opentui Textarea always adds its own defaults back on top.
    This affects all input_* keybinds, not just input_submit — it's the same root cause. The fix would need to happen in @opentui/core's mergeKeyBindings to allow user bindings to fully replace (not just supplement) the defaults.

  4. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  5. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions