From f7e4101992cf4bddf160b2817a7a2bcb03204009 Mon Sep 17 00:00:00 2001 From: Adam Hitchcock Date: Tue, 29 Sep 2026 18:22:06 -0700 Subject: [PATCH] feat(daemon): panes set FORCE_HYPERLINK=1 (#1025) * feat(daemon): panes set FORCE_HYPERLINK=1 tty7 renders OSC 8 links, but supports-hyperlinks only trusts a fixed TERM_PROGRAM list and strips them for tty7, so Claude Code's statusline PR links came out as plain text. Co-Authored-By: Claude Opus 5.5 * docs(daemon): note that FORCE_HYPERLINK also reaches redirected output --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> --- crates/tty7-core/src/daemon/pane.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/tty7-core/src/daemon/pane.rs b/crates/tty7-core/src/daemon/pane.rs index c7d986e8..511f3ff9 100644 --- a/crates/tty7-core/src/daemon/pane.rs +++ b/crates/tty7-core/src/daemon/pane.rs @@ -478,6 +478,13 @@ fn pane_environment( ), ("TERM_PROGRAM".to_string(), TERM_PROGRAM_NAME.to_string()), ("TERM_PROGRAM_VERSION".to_string(), version.to_string()), + // tty7 renders OSC 8 links, but `supports-hyperlinks` (Claude Code, + // most Node CLIs) only trusts a fixed TERM_PROGRAM list and strips + // them otherwise; this is the override it honours. It is checked + // before the isTTY test, so such a tool now writes OSC 8 into + // `> file` and `| less` too. `FORCE_HYPERLINK=0` in the `env` config + // or the shell's rc turns it back off. + ("FORCE_HYPERLINK".to_string(), "1".to_string()), (TTY7_PANE_ENV.to_string(), pane.to_string()), ]; #[cfg(windows)] @@ -7523,6 +7530,7 @@ mod tests { let version = env!("CARGO_PKG_VERSION"); assert_eq!(env.get("TERM_PROGRAM").map(String::as_str), Some("tty7")); + assert_eq!(env.get("FORCE_HYPERLINK").map(String::as_str), Some("1")); assert_eq!( env.get("TERM_PROGRAM_VERSION").map(String::as_str), Some(version)