[PR #415] [MERGED] fix(core): wrap kitty graphics query in tmux DCS passthrough #518

Closed
opened 2026-03-02 23:46:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/415
Author: @edlsh
Created: 12/13/2025
Status: Merged
Merged: 1/12/2026
Merged by: @kommander

Base: mainHead: fix/tmux-kitty-graphics-334


📝 Commits (10+)

  • c3b22bd fix(core): wrap kitty graphics query in tmux DCS passthrough
  • 933f322 fix(core): defer kitty graphics query until detection
  • 4a9aa5e move test script to core/dev
  • 84c70a8 Merge branch 'main' into fix/tmux-kitty-graphics-334
  • a107718 Merge branch 'main' into fix/tmux-kitty-graphics-334
  • e32902e Merge branch 'main' into fix/tmux-kitty-graphics-334
  • 595ebad wrap all
  • 408a6c7 stash
  • a8fe7d2 stash
  • e15ff5a Merge live/main into fix/tmux-kitty-graphics-334

📊 Changes

7 files changed (+405 additions, -24 deletions)

View changed files

packages/core/dev/test-tmux-graphics-334.sh (+68 -0)
📝 packages/core/docs/env-vars.md (+14 -0)
📝 packages/core/src/zig.ts (+6 -0)
📝 packages/core/src/zig/ansi.zig (+29 -0)
📝 packages/core/src/zig/renderer.zig (+4 -0)
📝 packages/core/src/zig/terminal.zig (+66 -24)
📝 packages/core/src/zig/tests/terminal_test.zig (+218 -0)

📄 Description

Fixes #334

Summary

  • Re-enable kitty graphics query (was disabled due to tmux pane title corruption)
  • Wrap query in tmux DCS passthrough when TMUX env var is present
  • Skip query entirely for TERM=screen*/tmux* without TMUX (could be GNU Screen)
  • Add OPENTUI_NO_GRAPHICS env var to disable query manually

Technical Details

The kitty graphics protocol uses APC sequences (\x1b_G...) which tmux intercepts and leaks into pane titles. The fix wraps the query in tmux's DCS passthrough format (\x1bPtmux;...\x1b\\) with ESC chars doubled per the protocol spec.

References:

Testing

# Native tests
cd packages/core/src/zig && zig build test --summary all
# 1241/1242 tests passed

Manual verification in tmux - pane title no longer shows Gi=31337...


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/415 **Author:** [@edlsh](https://github.com/edlsh) **Created:** 12/13/2025 **Status:** ✅ Merged **Merged:** 1/12/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix/tmux-kitty-graphics-334` --- ### 📝 Commits (10+) - [`c3b22bd`](https://github.com/anomalyco/opentui/commit/c3b22bd1a3e1db288a31a142c5eadd726cb2d62e) fix(core): wrap kitty graphics query in tmux DCS passthrough - [`933f322`](https://github.com/anomalyco/opentui/commit/933f3227c8a33940a53f387250de1ae7e9ee7ff2) fix(core): defer kitty graphics query until detection - [`4a9aa5e`](https://github.com/anomalyco/opentui/commit/4a9aa5e910d2924986dd3ebbf6fa27adc2cd1108) move test script to core/dev - [`84c70a8`](https://github.com/anomalyco/opentui/commit/84c70a81a7dcc30ab3defd06be640c3416a14522) Merge branch 'main' into fix/tmux-kitty-graphics-334 - [`a107718`](https://github.com/anomalyco/opentui/commit/a107718fa737e26edc4eea7fbfadc15feef11a86) Merge branch 'main' into fix/tmux-kitty-graphics-334 - [`e32902e`](https://github.com/anomalyco/opentui/commit/e32902edd5e900b2555e2235cf9288d3a587606b) Merge branch 'main' into fix/tmux-kitty-graphics-334 - [`595ebad`](https://github.com/anomalyco/opentui/commit/595ebad91f96e84d86c5f49bd26295dcac5a82cd) wrap all - [`408a6c7`](https://github.com/anomalyco/opentui/commit/408a6c70bc5932edfe722ecc9146603d829ed9c1) stash - [`a8fe7d2`](https://github.com/anomalyco/opentui/commit/a8fe7d2f51c1741605d8005480299301e405b682) stash - [`e15ff5a`](https://github.com/anomalyco/opentui/commit/e15ff5af57f5a67c0ecb9555cb360bb33807a52f) Merge live/main into fix/tmux-kitty-graphics-334 ### 📊 Changes **7 files changed** (+405 additions, -24 deletions) <details> <summary>View changed files</summary> ➕ `packages/core/dev/test-tmux-graphics-334.sh` (+68 -0) 📝 `packages/core/docs/env-vars.md` (+14 -0) 📝 `packages/core/src/zig.ts` (+6 -0) 📝 `packages/core/src/zig/ansi.zig` (+29 -0) 📝 `packages/core/src/zig/renderer.zig` (+4 -0) 📝 `packages/core/src/zig/terminal.zig` (+66 -24) 📝 `packages/core/src/zig/tests/terminal_test.zig` (+218 -0) </details> ### 📄 Description Fixes #334 ## Summary - Re-enable kitty graphics query (was disabled due to tmux pane title corruption) - Wrap query in tmux DCS passthrough when `TMUX` env var is present - Skip query entirely for `TERM=screen*/tmux*` without `TMUX` (could be GNU Screen) - Add `OPENTUI_NO_GRAPHICS` env var to disable query manually ## Technical Details The kitty graphics protocol uses APC sequences (`\x1b_G...`) which tmux intercepts and leaks into pane titles. The fix wraps the query in tmux's DCS passthrough format (`\x1bPtmux;...\x1b\\`) with ESC chars doubled per the protocol spec. **References:** - [Kitty Graphics Protocol - Querying Support](https://sw.kovidgoyal.net/kitty/graphics-protocol/#querying-support-and-available-transmission-mediums) - [tmux DCS Passthrough](https://man.archlinux.org/man/tmux.1.en) ## Testing ```bash # Native tests cd packages/core/src/zig && zig build test --summary all # 1241/1242 tests passed ``` Manual verification in tmux - pane title no longer shows `Gi=31337...` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:46:52 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#518
No description provided.