-
Notifications
You must be signed in to change notification settings - Fork 249
fix(core): wrap kitty graphics query in tmux DCS passthrough #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I can also update so:
This way we try passthrough for anything tmux-like, only skip for ambiguous screen* cases. |
4eae1a1 to
d3b637c
Compare
Also detect TERM=tmux* as tmux environment (for remote sessions where TMUX env var is not present) and use passthrough wrapper accordingly. Adds test script for manual verification of the fix. Documents OPENTUI_NO_GRAPHICS environment variable.
d3b637c to
c3b22bd
Compare
|
I tried playing with passthrough as well, the issue is opentui applications running remote, where the env will say "no tmux" and only delayed when maybe receiving an xtversion response will it know about tmux, but at that point will already have sent without DCS and mess up the window title. |
|
Could we restructure the query sequence so queryTerminalSend emits the graphics query only after parsing xtversion reveals the terminal type? |
|
Yeah, that would work. Sorry for the late answer. The xtversion query should be sent as very first query. Some caveat: the xtversion query may never get a response, as for example xterm.js (VSCode) does not send any. Maybe there are better ways to detect it remotely. So the tricky part would be to figure out a timeout that makes sense. |
|
hey @kommander — tweaked the deferred flow so tmux still gets the DCS-wrapped kitty query even if xtversion never responds (TMUX env). also added send/flush error logs. let me know if you want a timeout-based fallback for non-tmux terminals. |
|
Could work better, yeah. I think it's fine if it only works for local tmux to start with, as long as it doesn't send the escaped query for non-tmux. A little nitpick: We have One other thing, |
|
Hey, quick note on the tmux detection nit: if we drop and rely only on , xtversion from the inner terminal (e.g. kitty) can overwrite it and we’ll stop wrapping the kitty graphics query, which can reintroduce the pane-title corruption in tmux. The current code keeps from TMUX/TERM and uses that in sendPendingGraphicsQuery, so it stays safe even if xtversion later reports kitty. If we want to avoid the extra flag, we’d need to persist the tmux env in the name and avoid later overwrite, or keep a separate tmux-env flag. |
Fixes #334
Summary
TMUXenv var is presentTERM=screen*/tmux*withoutTMUX(could be GNU Screen)OPENTUI_NO_GRAPHICSenv var to disable query manuallyTechnical 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
Manual verification in tmux - pane title no longer shows
Gi=31337...