Skip to content

addon-image: Kitty graphics q=2 should suppress OK responses too#5884

Open
sotasan wants to merge 1 commit into
xtermjs:masterfrom
sotasan:addon-image-kitty-q2-suppresses-ok
Open

addon-image: Kitty graphics q=2 should suppress OK responses too#5884
sotasan wants to merge 1 commit into
xtermjs:masterfrom
sotasan:addon-image-kitty-q2-suppresses-ok

Conversation

@sotasan
Copy link
Copy Markdown

@sotasan sotasan commented May 18, 2026

Per the Kitty graphics protocol spec:

If you wish, you can suppress all responses by setting q=2. To suppress responses only for the OK status, set q=1.

The current _sendResponse implementation in KittyGraphicsHandler.ts only matches quiet === 1 for OK and quiet === 2 for errors, so a transmission with q=2 still emits an OK response — a violation of the spec and a real-world breakage for crossterm-based clients (e.g. yazi) that send q=2 precisely to get silence and whose input parser misinterprets the unsolicited APC response as keystrokes. Concretely, hovering over an image in yazi pumps ESC _ G i = N ; O K ESC \ into stdin, which crossterm reads as ; (open shell command line), G (jump to bottom), O (open with).

Changes quiet === 1quiet >= 1 for OK and quiet === 2quiet >= 2 for errors, making q=2 suppress both. Adds 4 tests mirroring the existing q=1 OK-suppression coverage:

  • Query (a=q): "suppresses OK response when q=2"
  • Transmit-only (a=t): "a=t OK suppressed by q=2"
  • Transmit-display (a=T): "a=T OK suppressed by q=2"
  • Placement (a=p): "OK response suppressed by q=2"

The 2-character behavior change has been validated end-to-end in a downstream xterm.js consumer where yazi previews now work cleanly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant