Skip to content

fix(native): xtversion in tmux#878

Open
AnatoleLucet wants to merge 1 commit intoanomalyco:mainfrom
AnatoleLucet:fix/xtversion-in-tmux
Open

fix(native): xtversion in tmux#878
AnatoleLucet wants to merge 1 commit intoanomalyco:mainfrom
AnatoleLucet:fix/xtversion-in-tmux

Conversation

@AnatoleLucet
Copy link
Copy Markdown

@AnatoleLucet AnatoleLucet commented Mar 26, 2026

currently hyperlinks need the terminal name to know if they are supported or not.
and the terminal name is either found using xtversion or TERM_PROGRAM=.

when running under tmux, the xtversion simply returns tmux, it does not return the real terminal's xtversion.
and TERM_PROGRAM= will more often than not be set to *-256color, which does not give use the terminal name either.

this will result in hyperlinks being detected as unsupported even though the user is running in an OSC8 compliant terminal.

currently hyperlinks are also predicted as being supported if COLORTERM is set to truecolor or 24bit, which can be false in a few environment, especially over ssh. i'll open a separate pr for that if that's fine

to fix this, i added an extra DSC wrapped xtversion query to make sure we get the proper terminal name under tmux.
i also cleaned the logic a bit around is_tmux because it was inconsistent.

[main] left kitty w/ tmux, right kitty w/o tmux
screenrecording-2026-03-26_13-27-09.mp4
hyperlinks are wrongly detected as unsupported under tmux.
[this pr] left kitty w/ tmux, right kitty w/o tmux
screenrecording-2026-03-26_13-25-44.mp4
hyperlinks are correctly detected as supported under tmux.

@simonklee
Copy link
Copy Markdown
Member

This breaks the tmux-via-xtversion flow the PR is trying to fix.

After the first unwrapped xtversion response, term_info is "tmux", but self.in_tmux has not been updated yet when sendPendingQueries() runs. With the new self.in_tmux checks, the wrapped retry xtversion / capability / graphics queries are skipped in that case. The old self.in_tmux or self.isXtversionTmux() logic handled this.

The test was also changed to set term.in_tmux = true up front, so it no longer covers the real transition.

@AnatoleLucet AnatoleLucet force-pushed the fix/xtversion-in-tmux branch from 62aa6b7 to 81d3583 Compare April 1, 2026 09:47
@AnatoleLucet
Copy link
Copy Markdown
Author

ah! indeed that's my mistake.
i reverted that part. it should me good now!

@AnatoleLucet AnatoleLucet force-pushed the fix/xtversion-in-tmux branch from 81d3583 to f79cb9a Compare April 1, 2026 09:50
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.

2 participants