Skip to content

fix(simulation): interpret named special keys in ui.press #37511

Description

@kitlangton

Problem

The canonical simulation action ui.press forwards its key string directly to OpenTUI mockInput.pressKey. Sending { "key": "escape" } types the literal word escape into the focused input instead of dispatching Escape.

This broke the OpenCode UI catalog after closing the command palette: the next slash command was entered into the still-open palette as escape/models.

Reproduction

  1. Launch a simulated TUI through OpenCode Drive.
  2. Open the command palette with ui.press for Ctrl+P.
  3. Send ui.press with key: "escape".
  4. Capture the terminal frame.

The palette remains open and its search contains escape.

Sending the raw escape byte "\u001b" works, but callers should not need transport-level key encoding for the protocol’s named key operation.

Expected

Named special keys such as escape are translated to the corresponding OpenTUI input event, with coverage for the canonical frontend simulation protocol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions