Skip to content

tui: keypad Home and End do nothing in the session prompt #57113

Closed as duplicate

Description

@argszero

Description

The keypad (NumLock) variants of Home and End do nothing in the session prompt. Plain Home and End move the caret, but NumPad Home and NumPad End are silently dropped, so a user on a full-size keyboard who navigates with the keypad cannot jump to the start or end of the prompt.

This is a small remaining gap in the same area as #56890 (report: plain Home/End jumped the transcript instead of moving the caret). The default transcript jumps no longer claim Home and End, and the keypad mirrors of the bare navigation keys are covered by #55870, but the two buffer commands in the prompt are not part of that change: input.buffer.home and input.buffer.end still default to none, so no binding claims the keypad names.

Plugins

None.

OpenCode version

V2, current dev (815de9950b), @opentui/core 0.6.6.

Steps to reproduce

  1. Open a session in a terminal that reports keypad keys with the kitty keyboard protocol (for example Windows Terminal, which sends CSI 57423 u for NumPad Home and CSI 57424 u for NumPad End).
  2. Type two lines into the prompt, for example aa, Shift+Enter, bb, leaving the caret at the end.
  3. Press NumPad Home, then type x.
  4. Press NumPad End, then type y.

Observed: the prompt reads aa\nbbxy — both keypad keys were ignored and the characters went in at the caret.

Expected: the prompt reads xaa\nbby — NumPad Home and NumPad End land where plain Home and End land, which is the start and the end of the prompt.

The same measurement can be taken without a physical keypad by feeding the two CSI-u sequences to the renderer, which is how the reproduction in the pull request is automated.

Screenshot and/or share link

Not applicable; deterministic renderer reproduction.

Operating System

Linux

Terminal

Kitty

Activity

  1. argszero commented on Oct 19, 2026

    @argszero
    ContributorAuthor

    Fix opened in #57114.

    Cause: input.buffer.home / input.buffer.end defaulted to none, so no binding claimed the keypad names in the session prompt. Measured plain Home first, with the transcript jumps unbound — on a two-line prompt with the caret at the end, Home then x gives xaa\nbb, i.e. plain Home is a start-of-buffer move — so the keypad keys are bound to the buffer commands rather than the line commands (ctrl+a / ctrl+e), which would have meant something different.

    The regression test feeds the same CSI 57423 u / CSI 57424 u sequences this report describes and asserts xaa\nbby, so the fix is checked against the exact reproduction.

  2. opencode-agent commented on Oct 19, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the deterministic reproduction!

    I think this is a duplicate of #55533. That issue reports the same root cause: under the kitty keyboard protocol, NumPad Home/End arrive as kphome/kpend (CSI 57423 u / CSI 57424 u), no default keybind names them, and they get dropped. It also expects every NumPad navigation key to act like its regular counterpart, which includes the session prompt. You're right that PR #55870 doesn't cover input.buffer.home/input.buffer.end. That's a gap in the fix for #55533, though, not a separate problem, so your PR #57114 can address it under #55533.

    Possible duplicates and related issues, ordered from most to least likely:

    Until a fix lands, you can bind the keypad keys yourself in your TUI config:

    "keybinds": {
      "input.buffer.home": "kphome",
      "input.buffer.end": "kpend"
    }

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  3. opencode-agent commented on Oct 20, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #55533, since there hasn't been a reply in the past day explaining how it differs. Both are about NumPad Home/End (kphome/kpend) being dropped because no default keybind names them. Please follow #55533 for updates. Your PR #57114 can address the prompt's input.buffer.home/input.buffer.end gap there.

    Until a fix lands, binding "input.buffer.home": "kphome" and "input.buffer.end": "kpend" in your TUI config should work around it. If this turns out to be a different problem, reply here and it can be reopened. Thanks again for the clear reproduction!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions