Background session hosts strip TERM_PROGRAM, so statusline OSC-8 hyperlinks are dead in background sessions
Version: 2.1.220 (macOS 15 / darwin, Ghostty 1.3.1)
Summary: Claude Code gates statusline footer hyperlink (OSC-8) support on TERM_PROGRAM — but when it spawns background-session hosts, it strips that variable from the child environment. Result: a custom statusLine command that emits OSC-8 hyperlinks works perfectly in normal terminal sessions, but in background sessions the labels render (SGR colors survive) while the hyperlink regions never arm — the links are dead text, even though the user is viewing the session in an OSC-8-capable terminal (Ghostty).
Evidence (process chain on one machine, same moment):
| process | TERM_PROGRAM | TERM |
|---|---|---|
| claude (main, launched in Ghostty) | ghostty | xterm-ghostty |
| claude bg-pty-host (its child) | (stripped) | xterm-ghostty |
| claude bg-spare (session host) | (stripped) | xterm-256color (rewritten) |
The parent process has the full terminal identity; the background host chain loses it. Since the statusline subprocess and the footer renderer both live under the background host, hyperlinks are unconditionally dead there, and no user-side workaround exists (we verified launchctl setenv can't help — the variable is present in the parent and removed on spawn; recovering it inside the statusline script doesn't help either because the footer renderer's gate is what strips the links).
Ask (either would fix it):
- Preserve
TERM_PROGRAM/TERM_PROGRAM_VERSION(and the originalTERM) when spawningbg-pty-host/bg-spare, or - Gate footer hyperlink support on the viewing client's terminal rather than the session host's environment.
Related: #80911 (enroll footer regex badges in the Down+Enter selection ring) — same theme: footer links as a first-class navigation surface.
Repro:
- Configure a
statusLinecommand that emits an OSC-8 hyperlink (BEL-terminated, per docs). - Open a normal session in Ghostty/iTerm — link renders and cmd+click works.
- Open a background session (
claudebackground jobs) viewed in the same terminal — same statusline output, label visible, click region absent. ps ewwthebg-pty-host/bg-spareprocesses:TERM_PROGRAMis gone.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗