Add Hls to xterm-ghostty terminfo so tmux auto-detects OSC 8 hyperlink passthrough
#13063
Replies: 2 comments 1 reply
-
|
Moved here from #13062 (closed/locked automatically because non-maintainers cannot file issues per CONTRIBUTING.md). Content is reproduced verbatim above. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
No human in the loop. Piss off. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Inside tmux, OSC 8 hyperlinks emitted by programs are silently dropped under
Ghostty unless the user manually opts in with
set -as terminal-features '*:hyperlinks'. Out of the box, hyperlinks that workin a bare Ghostty pane disappear the moment the program runs inside tmux.
Root cause
tmux (≥3.4) only re-emits OSC 8 hyperlinks to the outer terminal when the client
terminal's terminfo carries the
Hlsextended capability. This is tmux'shyperlinksterminal-feature, whose only capability isHlsintty-features.c(tty_feature_hyperlinks/tty_feature_hyperlinks_capabilities,roughly):
https://github.com/tmux/tmux/blob/master/tty-features.c
The
xterm-ghosttyterminfo ships noHls:src/terminfo/ghostty.zigalready defines plenty of modern extended caps(
Smulx,Setulc/Su,Ss/Se,Msfor OSC 52 clipboard,Sync, bracketedpaste,
fullkbd, …) but notHls. Notably it already shipsMsfor OSC 52clipboard while lacking
Hlsfor OSC 8 hyperlinks — a clean, consistent gap.Why it matters (incl. SSH propagation)
Ghostty already renders OSC 8 hyperlinks in a bare pane, so users reasonably
expect them to keep working inside tmux — the most common multiplexer. Today
they don't, and the fix is a single terminfo capability rather than per-user
tmux config.
It also propagates over SSH for free. Ghostty's
ssh-terminfointegration(
installRemoteTerminfoinsrc/cli/ssh.zig) encodes the bundled terminfo —extended caps included — and installs it on the remote host via
tic -x -,which preserves extended capabilities. So if
xterm-ghosttyshippedHls, tmuxwould auto-detect hyperlink passthrough both locally and on SSH'd-into hosts
with zero user configuration.
Reproduction
Core proof (portable, no helper script):
Empirical confirmation — three isolated tmux servers (private socket, explicit
-fconfig, no user config), each attached insidescript(1)so the typescriptcaptures exactly the bytes tmux draws to the outer tty. A pane emits an OSC 8
hyperlink; we count
ESC ] 8introducers reaching the outer tty (0 = dropped,≥1 = passed through; tmux re-emits with its own
id=tmuxN, so a pass istypically 2):
ESC]8in outer ttyxterm-ghosttyHlsxterm-ghosttyset -as terminal-features '*:hyperlinks'The only difference between A and B is the
Hlscapability — isolating themissing cap as the root cause. Self-contained script:
Output (tmux 3.6a, Linux, util-linux
script):Suggested fix
Add the
Hlsextended capability tosrc/terminfo/ghostty.zig, using tmux'scanonical value:
User-side workaround (for reference)
Related
Hlsbut is about runtime query discovery, not the static terminfo entry tmux reads
at compile time — this is the simpler, separate fix.
Environment
infocmp/tic(extended-cap aware)scriptsyntax)Beta Was this translation helpful? Give feedback.
All reactions