Skip to content

[Bug]: CLI - hyperlinks are disabled by default on GNOME Terminal, and under tmux the decision is delegated to a tmux flag that is off by default #543

Open

Description

@sandeep-alluru

Product or interface

CLI - interactive TUI

Version

0.6.12

Platform

Linux

OS version and architecture

Ubuntu 24.04.3 LTS x86_64

Issue area

UI / UX

Desktop log upload ID (optional)

No response

Steps to reproduce

  1. Run the interactive TUI: mcode
  2. Produce a markdown link in the transcript — a URL, or a path to a file.
  3. Try to click it.

Expected and actual behavior

Expected: the link is clickable, the way a link in any other terminal-rendered markdown is.

Actual: it is rendered as plain text. There is no click target.

The renderer does have OSC 8 support — it emits ESC ] 8 ; ; URI ST … ESC ] 8 ; ; ST — but it sits behind a runtime capability check, and on this setup the check comes back "no".

The capability table is keyed on the terminal:

// kitty, ghostty, wezterm, warp, iterm, Windows Terminal, VS Code, alacritty -> hyperlinks: true
// screen -> false, Windows -> false, jetbrains-jediterm -> false
// under tmux -> the tmux probe below
// everything else -> false

Under tmux the decision is delegated to tmux:

function Hk(){try{return exec("tmux display-message -p '#{client_termfeatures}'",
  {encoding:"utf8",timeout:250,stdio:["ignore","pipe","ignore"]})
  .split(",").map(e=>e.trim()).includes("hyperlinks")}catch{return!1}}

client_termfeatures reports the features tmux has configured for the outer terminal, and tmux's built-in default for the xterm* class is:

terminal-features[0]  xterm*:clipboard:ccolour:cstyle:focus:title

which does not include hyperlinks. So on a default Linux + tmux + GNOME Terminal setup mcode concludes "no hyperlink support" — even though GNOME Terminal handles OSC 8 perfectly well. The user gets no clue why.

Two things would help here:

  1. GNOME Terminal is not in the table. kitty, ghostty, wezterm, warp, iTerm2, Windows Terminal, VS Code and alacritty are all listed with hyperlinks: true, and anything not listed falls through to false. GNOME Terminal (VTE), Konsole, foot and plain xterm all support OSC 8 and would all be excluded.

  2. Under tmux, the check could fall back to the outer terminal. The tmux probe is authoritative only as far as tmux's own configuration goes, and the default is conservative — it does not know the outer terminal is a GNOME Terminal. When the probe says no, it would be reasonable to also detect the outer terminal, or to emit the OSC 8 sequence anyway, since a terminal that does not understand it simply shows the text, which is what happens today.

The fallback rendering is also lossy. With hyperlinks off, the renderer prints text (https://url) — but only when the link text differs from the URL. For an autolink, where the text is the URL, it prints the bare URL with nothing marking it as a link.

Redacted error summary

# tmux's default feature list for the xterm* class - no "hyperlinks"
$ tmux show -g terminal-features
terminal-features[0]  xterm*:clipboard:ccolour:cstyle:focus:title

# what mcode asks tmux
$ tmux display-message -p '#{client_termfeatures}'
bpaste,ccolour,clipboard,cstyle,focus,margins,rectfill,title

# adding the flag is what makes it work
$ tmux set -g terminal-features[0] "xterm*:clipboard:ccolour:cstyle:focus:title:hyperlinks"
$ tmux display-message -p '#{client_termfeatures}'
bpaste,ccolour,clipboard,hyperlinks,cstyle,focus,title

Notes

There is already an escape hatch — PI_HYPERLINKS=1 forces the capability on regardless of the table, and PI_HYPERLINKS=0 forces it off. I could not find it documented anywhere, and it does not help the tmux case above, because the tmux branch asks tmux rather than asking the terminal. If it is meant to stay, it would be worth a line in the docs.

Before submitting

  • I have searched existing issues.
  • I have included my version and removed sensitive information.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tuiInteractive terminal UI (TUI)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions