fix(ui): don't probe for kitty graphics under tmux - #3525
Open
olifarhaan wants to merge 1 commit into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Running crush inside tmux under kitty types
Gi=31;OKinto the editor on startup. That string is crush's own capability probe coming back at itWhy it happened
QueryCmd(capabilities.go:91) sends the kitty graphics query wrapped in tmux passthrough, so the outer terminal answers with\x1b_Gi=31;OK\x1b\. tmux's key parser has no APC branch, so unless the whole reply lands in a single read it degrades into Alt+_, the printable runGi=31;OK, and Alt+\, and the printables reach the pane as keystrokes.shouldQueryCapabilitiesreturns true for tmux, so the probe goes out in the first placeFix
Skip the kitty graphics query in
QueryCmdwhenTMUXis set. XTVERSION and the pixel-size query still go out, since tmux answers those itselfCloses #3500
Proof
Ran crush inside tmux on a pty, then played back the exact reply kitty sends. The harness only injects a reply if crush actually asked, matching what a real terminal does:
Script: https://gist.github.com/olifarhaan/0fafcd38a80a0c2f4786a7dab603ef36
By hand, on kitty:
tmux new-session crush, and the prompt readsGi=31;OKbefore this change and stays empty afterTests
TestQueryCmdSkipsKittyGraphicsUnderTmuxfails onmain:go test -race ./internal/ui/...and golangci-lint v2.11 both clean