Skip to content

[Bug]: Ctrl+F3 does not reach ncurses terminal bindings #37189

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a thread terminal in the Linux Chromium web client.
  2. Run a Python curses program with screen.keypad(True) and log screen.get_wch() values.
  3. Press Ctrl+F1, Ctrl+F3, and Ctrl+F4.
  4. Compare with infocmp -1 xterm-256color: kf27=\E[1;5R.

Expected behavior

Ctrl+F3 reaches ncurses as KEY_F(27), matching the server's advertised TERM=xterm-256color.

Actual behavior

The terminal sends ESC[13;5~, which ncurses reads as literal characters. The adjacent function-key controls decode correctly. Bundled Ghostty deliberately uses this alternative F3 encoding; the mismatch is between that encoding and T3's advertised terminfo.

Impact

Minor bug or occasional failure. Affected function-key bindings do not fire; real-user frequency is unknown.

Version or commit

Reproduced on 1b14aade4de1db0c82b8d61ccfd9c011b04c3810, with final red/green proof against 7379f1969b0f4b579327cf81299ef8cc3ddf8e9c.

Environment

Linux, Chromium, trusted CDP keyboard events, real server PTY and ncurses. Physical keyboard, Electron, other operating systems, and mobile were not tested.

Logs or stack traces

Base ncurses key names: KEY_F(25) ^[ [ 1 3 ; 5 ~ KEY_F(28).

Screenshots, recordings, or supporting files

Found by the Terminal Improvement Bug Hunt, independently confirmed by Claude Opus 5.5. Finding and reproduction.

Workaround

Use another binding. Programs that negotiate Kitty keyboard mode use its separate encoding.

Activity

  1. added
    vouch:trusted
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions