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 <noreply@anthropic.com>

* docs(daemon): note that FORCE_HYPERLINK also reaches redirected output

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
This commit is contained in:
Adam Hitchcock
2026-09-30 09:22:06 +08:00
committed by GitHub
co-authored by Claude Opus 5.5 l0ng-ai
parent cd5bf5508c
commit f7e4101992
+8
View File
@@ -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)