Skip to content

opentui: bug: Selecting a model by pressing enter also send message in chat #3774

Closed

Description

@Mishkun

Description

I think that key events are not consumed properly in opentui by the handlers

OpenCode version

v1.0.11

Steps to reproduce

  1. launch opencode
  2. type something in chatbox
  3. launch model selector ctrl+x m
  4. select any model by pressing enter

Result: model is selected and message is sent to it

expected result: model is selected, message stays unsent and editable

Screenshot and/or share link

No response

Operating System

macos

Terminal

iterm2

Activity

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

    @github-actions
    Contributor

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

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

  3. Mishkun commented on Nov 2, 2025

    @Mishkun
    ContributorAuthor

    still reproducable on 06ac1be

    pressed enter 1 time

    Screen.Recording.2025-11-02.at.20.39.03.mov
  4. thdxr commented on Nov 2, 2025

    @thdxr
    Member

    @kommander i am doing preventDefault() in the input for dialog-select but i think textarea triggers keybinds anyway

  5. kommander commented on Nov 2, 2025

    @kommander
    Contributor

    That worked until recently, I can reproduce. Need to check.

  6. kommander commented on Nov 2, 2025

    @kommander
    Contributor

    @thdxr the "Submit prompt" command is triggered by the global keybind.

    {
      title: "Submit prompt",
      value: "prompt.submit",
      disabled: true,
      keybind: "input_submit",
      category: "Prompt",
      onSelect: (dialog) => {
        submit()
        dialog.clear()
      },
    },

    In the config.ts:

    input_submit: z.string().optional().default("return").describe("Submit input"),

    The keybind.tsx listener is global and triggers that command it seems.

  7. thdxr commented on Nov 3, 2025

    @thdxr
    Member

    ^ yep fixed now

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions