packages/tui/src/stdin-buffer.ts — in extractCompleteSequences, after finding \x1b\x1b as "complete" (legacy meta-key), check if the next character in the buffer would start a new escape sequence ([, ], O, P, _). If so, emit only the first \x1b and let the second ESC begin a new parse iteration.
packages/tui/test/stdin-buffer.test.ts — three new cases in the Kitty section:
- \x1b\x1b[27;129:3u (num_lock) splits into ["\x1b", "\x1b[27;129:3u"]
- \x1b\x1b[27;1:3u (no num_lock) splits into ["\x1b", "\x1b[27;1:3u"]
- \x1b\x1b alone (no following CSI) still emits as ["\x1b\x1b"] — preserves ctrl+alt+[
Emit OSC 9;4 progress start/end sequences during agent streaming and
compaction so terminals (iTerm2, WezTerm, Windows Terminal, Kitty, etc.)
show activity in their tab bar.
Made with love for @lucasmeijer
Only use fd --full-path for path queries so plain fuzzy @ autocomplete results no longer depend on whether the cwd path contains the query text.
closes#2778
OSC 8 hyperlinks landed in #3248, but detectCapabilities() returned
hyperlinks: true in the unknown-terminal fallback. Terminals that
silently swallow OSC 8 (most xterm-compatible hosts, tmux/screen
without passthrough) end up dropping the URL from rendered markdown
links entirely, since the fallback 'text (url)' rendering is skipped
whenever hyperlinks is true.
- Unknown terminals now default to hyperlinks: false.
- tmux and screen (TMUX env, TERM starting with tmux/screen) force
hyperlinks: false even when the outer terminal would otherwise
advertise OSC 8 support. Image protocols also left disabled.
- Added detectCapabilities tests covering the known-capable set and
the tmux/screen/unknown cases.
TerminalCapabilities already tracks hyperlinks: boolean and returns true
for Ghostty, Kitty, WezTerm, and iTerm2, but nothing generated OSC 8
sequences. This completes that stub.
Changes to packages/tui:
- terminal-image.ts: add hyperlink(text, url) and setCapabilities()
- index.ts: export hyperlink and setCapabilities
- utils.ts: extend AnsiCodeTracker to track active OSC 8 URLs
- process() now handles OSC 8 open/close sequences
- getActiveCodes() re-emits the OSC 8 open at each line start
- getLineEndReset() closes the OSC 8 hyperlink before each line break
This ensures hyperlinks wrap correctly across multiple lines.
- components/markdown.ts: link renderer uses hyperlink() when
getCapabilities().hyperlinks is true; falls back to (url) text
- Tests: new wrap-ansi tests for OSC 8 line-wrapping; terminal-image
tests for hyperlink(); markdown tests covering both code paths;
table-cell width test pinned to hyperlinks:false (checks raw columns)
closes#3239
Co-authored-by: AI (Pi/Claude Sonnet 4.6) <noreply@pi.dev>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This reverts 3929e0c181.
The Zellij-specific Kitty-query skip regresses Shift+Enter newline handling in Zellij. Restoring the previous behavior for now while we work on a safer fix that preserves both Alt and modified Enter handling.\n\nContext: https://github.com/badlogic/pi-mono/issues/3259
Tests assumed renders complete synchronously after requestRender() +
nextTick + flush(), but commit 6f5f37f8 changed requestRender() to
schedule via setTimeout with a 16ms minimum interval. Tests reading
viewport state before doRender() runs saw stale data.
Add VirtualTerminal.waitForRender() helper that waits for the throttled
render to settle (nextTick + 20ms + xterm flush), and replace all
terminal.flush() calls after render-triggering actions with it.
Fixes 8 failing tests across overlay-short-content, tui-render, and
markdown test suites.
Headings applied styling (bold+cyan) as an outer wrapper around the
result of renderInlineTokens. When inline elements like codespan emitted
ANSI resets, the outer heading style was killed and only the default
text style was restored via stylePrefix.
Fix: pass a heading-specific InlineStyleContext into renderInlineTokens
so each text segment gets heading styling directly, and stylePrefix
restores heading style after inline elements.