pi-mono/packages/tui/src
robopipi[bot] 2af8a42f5f
fix(tui): detect Alacritty for OSC 8 hyperlinks without TERM_PROGRAM (#11777)
Hyperlink detection recognised Alacritty only through
`TERM_PROGRAM=alacritty`, and Alacritty never sets `TERM_PROGRAM`. So in
a default Alacritty setup, pi fell back to `hyperlinks: false` and
rendered Markdown links as `label (url)` instead of clickable OSC 8
links.

Alacritty does set two other variables, which this change now checks:
- `TERM=alacritty` when its terminfo entry is installed (otherwise
`TERM=xterm-256color`);
- `ALACRITTY_WINDOW_ID` for the shell on Unix and macOS. This covers the
common macOS case where the terminfo entry is missing.

The tmux and screen checks still run first, so behaviour inside
multiplexers is unchanged.

**Testing**
- Added a `detectCapabilities` test covering `TERM=alacritty` and
`TERM=xterm-256color` with `ALACRITTY_WINDOW_ID`. It fails without the
change and passes with it.
- `node --test test/*.test.ts` in `packages/tui`: 1121 passing tests.
- `npm run check` passes.
- Checked `detectCapabilities()` with clean environments:
- Before: `TERM=alacritty` and `ALACRITTY_WINDOW_ID=123` both gave
`hyperlinks: false`.
  - After: both give `hyperlinks: true`.
- Plain `xterm-256color` and tmux with `ALACRITTY_WINDOW_ID` still give
`false`.

Fixes #11767

Requested by @badlogic

Co-authored-by: triagent <triagent@localhost>
2026-11-04 09:26:27 +01:00
..
components fix(tui): hide HTML comments in Markdown rendering (#11755) 2026-11-03 22:33:03 +01:00
alt-screen-search.ts fix(tui): make fullscreen transcript search scale linearly 2026-09-04 10:22:04 +02:00
autocomplete.ts fix(tui): escape regex metacharacters in single-segment fd queries (#11212) 2026-10-21 12:21:15 +02:00
colors.ts feat(coding-agent,tui): System theme (#10067) 2026-09-26 13:33:47 +02:00
editor-component.ts chore(ts): use source import extensions 2026-05-20 00:04:03 +02:00
fuzzy.ts fix(tui,coding-agent): rank contiguous fuzzy matches and search session fields separately 2026-10-22 21:39:17 +02:00
index.ts fix(tui,coding-agent): handle selection page keys in all scrolling lists 2026-10-28 19:05:21 +01:00
keybindings.ts fix(tui,coding-agent): handle selection page keys in all scrolling lists 2026-10-28 19:05:21 +01:00
keys.ts fix(tui): recognize kitty F1-F12 sequences and ignore F13+ keys (#11468) 2026-10-27 09:16:36 +01:00
kill-ring.ts Add the kill ring and undo features to the Input component (#1373) 2026-02-07 15:47:27 +01:00
latex.ts fix(tui): improve LaTeX compatibility and layouts 2026-09-19 23:28:04 +02:00
layout-node.ts feat(tui): add configurable fullscreen scrollbars 2026-07-31 17:17:02 +02:00
layout.ts fix(tui): bound image line search by tallest registered image 2026-10-23 21:59:31 +02:00
native-modifiers.ts feat(tui): Simplify clipboard handling (#9163) 2026-09-05 23:52:32 +02:00
native-module-path.ts feat(coding-agent): bundle Node runtime (#8474) 2026-08-22 21:19:38 +02:00
native-platform.ts fix(coding-agent,tui): paste Finder file paths instead of icons (#10136) 2026-09-28 20:59:29 +01:00
oklab.ts feat(coding-agent,tui): System theme (#10067) 2026-09-26 13:33:47 +02:00
program-status.ts fix: harden handling of untrusted URLs, terminal text, and streamed data 2026-10-26 20:46:31 +01:00
stdin-buffer.ts fix(tui): keep delayed terminal replies out of keyboard input 2026-10-11 20:17:00 +02:00
terminal-colors.ts feat(coding-agent,tui): System theme (#10067) 2026-09-26 13:33:47 +02:00
terminal-image.ts fix(tui): detect Alacritty for OSC 8 hyperlinks without TERM_PROGRAM (#11777) 2026-11-04 09:26:27 +01:00
terminal.ts fix(tui): treat ESC+Return with native Shift held as Shift+Enter 2026-10-29 20:17:54 +01:00
tui-alt-screen.ts fix(tui,coding-agent): handle selection page keys in all scrolling lists 2026-10-28 19:05:21 +01:00
tui-main-screen.ts fix(tui): stop writing OSC 133 prompt markers in regular mode (#11565) 2026-10-29 14:00:16 +01:00
tui.ts fix(tui,coding-agent): handle selection page keys in all scrolling lists 2026-10-28 19:05:21 +01:00
undo-stack.ts Add the kill ring and undo features to the Input component (#1373) 2026-02-07 15:47:27 +01:00
utils.ts fix(tui): drop space after styled word at wrap boundary, reset strikethrough at line end (#11591) 2026-10-29 22:08:18 +01:00
wheel-scroll.ts feat(tui,coding-agent): configurable fullscreen wheel scrolling with auto acceleration 2026-09-29 09:57:53 +02:00
word-navigation.ts fix(tui): align input word segmentation with editor (#5068) 2026-05-27 20:50:04 +02:00