Skip to content

fix(simulation): mirror kitty keyboard protocol - #39741

Merged
kitlangton merged 1 commit into
v2from
simulation-kitty-input
Jul 30, 2026
Merged

fix(simulation): mirror kitty keyboard protocol#39741
kitlangton merged 1 commit into
v2from
simulation-kitty-input

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Keep headless simulation input on the same keyboard protocol configured for the TUI. This makes simulated keys behave like keys sent to the corresponding OpenTUI renderer.

Before / After

Before: SimulationRenderer.create({ useKittyKeyboard: ... }) forwarded the option to the application but created the headless OpenTUI renderer without kittyKeyboard. A simulated Escape was therefore emitted as legacy input, which could enter OpenTUI's escape-sequence disambiguation path instead of behaving like the configured Kitty key.

After: the headless renderer receives kittyKeyboard: true whenever useKittyKeyboard is configured. Simulated Escape is emitted immediately with source: "kitty", matching the application's keyboard mode.

How

  • packages/simulation/src/frontend/renderer.ts mirrors useKittyKeyboard into createTestRenderer.
  • packages/simulation/test/actions.test.ts verifies that ui.press("escape") emits a Kitty keyboard event.

Scope

This only aligns the existing headless renderer with the existing application option. It does not change key normalization, terminal input parsing, or the simulation protocol.

Testing

  • bun test in packages/simulation (39 tests)
  • bun run typecheck in packages/simulation
  • Repository pre-push typecheck (33 packages)

Flow

sequenceDiagram
    participant App as Simulated TUI
    participant Renderer as Headless OpenTUI renderer
    participant Drive as Simulation client

    App->>Renderer: configure Kitty keyboard mode
    Drive->>Renderer: press Escape
    Renderer-->>App: keypress source=kitty
Loading

@kitlangton
kitlangton enabled auto-merge (squash) July 30, 2026 19:53
@kitlangton
kitlangton merged commit 9abd959 into v2 Jul 30, 2026
9 checks passed
@kitlangton
kitlangton deleted the simulation-kitty-input branch July 30, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant