Repository navigation
Windows: terminal markers enable unsupported Kitty input, breaking Esc and Ctrl+U #4086
ilepn
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Native Windows Prime Agent 0.10.3 can enable Kitty keyboard reporting even though its Windows console input backend cannot decode those sequences. In the model picker, Esc inserts
[27uinstead of closing it; Ctrl+U also inserts sequence text instead of clearing the filter.Environment and reproduction
prime-agent-0.10.3-win32-x64release. The installed executable's hash matched the executable extracted from the official release archive.TERM_PROGRAM=ghostty(the private ConPTY reproduction usedTERM=xterm-256colorandTERM_PROGRAM=ghostty)./model.[27u.The private ConPTY capture establishes the protocol boundary:
ESC[>7uESC[27u[27uappears in the pickerESC[27;1;27;1;0;1_TERM=dumbin a fresh control processTERM=dumbwas only a diagnostic control, not the proposed fix.Cause and proposed fix
At release commit
efb25e2be62507f8a13a157545d031da213abac9,keyboard_capabilitytrusts direct-terminal environment markers without checking the input backend. This can enable Kitty on Windows despite the non-Unix probe deliberately settling unsupported. The vendored Windows event reader consumes consoleINPUT_RECORDs, rather than parsing Kitty byte sequences.A local candidate adds this guard before inspecting the environment in
keyboard_capability:This keeps Unix negotiation and the existing teardown cleanup intact. It changes protocol selection for the backend instead of adding mappings for individual keys. Placing the guard in
local_keyboard_capabilityis another possible implementation choice.Verification
A verification agent exercised the original and candidate binaries, and a separate review agent checked the protocol-selection and Windows-reader paths.
only_direct_terminal_markers_skip_the_probetable to expectUnsupportedon non-Unix platforms. It failed before the fix (Supported != Unsupported), then passed without further test edits.enhanced_keys::testspassed.cargo fmt --all --checkandcargo check -p pa-tui --target x86_64-pc-windows-msvc --lockedpassed.TERMworkaround. I also tested the candidate interactively and confirmed it works.Validation limits: the candidate was a debug build with a 16 MiB linker stack because the ordinary debug build overflowed before rendering. Strict clippy stopped at existing
pa-typesmap_unwrap_orwarnings under rustc 1.100.0. Full workspace tests, a release-profile candidate and Unix runtime tests were not run. A bare raw Escape after text did not close the picker in the minimal ConPTY emulator; native Windows Escape and the actual Herdr route passed. No claim of full terminal emulation is intended.WSL comparison
The unmodified Linux 0.10.3 build, launched through a Windows-to-WSL shim in the same Herdr test space, passed Ctrl+U, Down and Esc in the model picker. No model response was tested. This further isolates the reproduced failure to the native Windows input path.
Originally filed as #4085, which the intake bot closed and redirected here under CONTRIBUTING.md.
All reactions