Commit Graph

315 Commits

Author SHA1 Message Date
Mario Zechner
bdb416cbc0 fix(tui): deduplicate kitty printable input
closes #3780
2026-04-27 21:02:40 +02:00
Georgi
d06db09a53 fix(tui): decode CSI-u Ctrl+letter inside bracketed paste, fixes #3599 (#3623)
Co-authored-by: Georgi Chochev <georgi.chochev@siteground.com>
2026-04-24 13:30:49 +02:00
Mario Zechner
76bc605ad1 fix(tui): keep terminal progress alive
closes #3610
2026-04-23 23:39:06 +02:00
Mario Zechner
3dacaa8ed9 fix(coding-agent,tui): drop typebox compiler shim and fix progress 2026-04-22 21:12:20 +02:00
Mario Zechner
8234ebf9ee feat(coding-agent,tui): add stacked autocomplete providers closes #2983 2026-04-22 15:44:08 +02:00
Mario Zechner
a900d25119 feat(tui,coding-agent): add OSC 9;4 terminal progress indicators
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
2026-04-22 11:55:52 +02:00
Mario Zechner
780d536727 fix(tui): follow symlinks in fuzzy autocomplete closes #3507 2026-04-22 00:35:19 +02:00
Mario Zechner
968430f63e fix(tui): avoid cwd-path matches in @ autocomplete
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
2026-04-20 22:44:34 +02:00
Mario Zechner
5a4e22ea44 fix(coding-agent): remove process-cwd tool singletons and use tool-name allowlists
- switch SDK/CLI tool selection to name-based allowlists
- apply allowlists across built-in, extension, and SDK tools
- remove ambient process.cwd defaults from core tooling and resource helpers
- update tests, examples, and TUI callers for explicit cwd plumbing
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner
74139c3f66 feat(coding-agent): add configurable working indicator closes #3413 2026-04-20 16:28:39 +02:00
Mario Zechner
6b55d6859d fix(tui): restore shifted xterm input
closes #3436
2026-04-20 15:36:10 +02:00
Andrés Vinueza
aa25726ebf feat(coding-agent,tui): support argument-hint frontmatter in prompt templates (#2780)
* feat(coding-agent,tui): support argument-hint frontmatter in prompt templates

Parse argument-hint from prompt template frontmatter and display it
in the autocomplete dropdown description, matching Claude Code's
convention for custom commands.

Frontmatter format:
  ---
  description: Code review
  argument-hint: "[file | #PR | PR-URL]"
  ---

The hint renders in the description column of the autocomplete list:
  review   [file | #PR | PR-URL] — Code review

Closes #2761

* docs(coding-agent,tui): add argument-hint documentation, tests, and built-in hints

- Document argument-hint frontmatter in prompt-templates.md with <required>/[optional] convention
- Add argument-hint to built-in prompts: pr, is, wr
- Expand tests: required/optional hints, missing hints, empty hints, special characters
- Add changelog entries for coding-agent and tui
2026-04-16 23:02:35 +02:00
Mario Zechner
30a8a41fc3 fix(tui): default hyperlinks off for unknown terminals and tmux/screen
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.
2026-04-16 22:19:38 +02:00
Omair Ahmed
e8743e870b feat(tui): use OSC 8 hyperlinks in Markdown when terminal supports them (#3248)
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>
2026-04-16 22:13:36 +02:00
Armin Ronacher
5b84152b17 revert(tui): temporarily undo Zellij Kitty-query bypass
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
2026-04-16 20:00:54 +02:00
Armin Ronacher
db5274b48c fix(markdown): require double-tilde strikethrough delimiters 2026-04-16 12:37:13 +02:00
Mario Zechner
3929e0c181 fix(tui): skip Kitty query inside Zellij\n\nfixes #3163 2026-04-15 18:43:37 +02:00
Mario Zechner
5ed4600350 fix(tui): resolve rebase typo closes #2979 2026-04-14 20:41:28 +02:00
Mario Zechner
ddb8454c87 fix(tui): complete super key helper support closes #2979 2026-04-14 20:40:34 +02:00
Kao Félix
6cf5098f6b Fix Ctrl+Alt key matching in tmux (#2989) 2026-04-14 20:36:08 +02:00
Sviatoslav Abakumov
4dda448a3f fix(tui): preserve column of cursor before it entered a paste marker (#3092) 2026-04-13 11:03:18 +02:00
Mario Zechner
3b7448d156 fix(tui): replace spread-into-push in Container.render() to prevent stack overflow, closes #2651 2026-04-09 03:33:09 +02:00
Mario Zechner
6f5f37f85a fix(tui): throttle render scheduling under streaming load 2026-04-06 02:03:50 +02:00
Mario Zechner
af12464217 fix(tui): avoid overlay scrollback inflation on widen 2026-04-02 01:31:09 +02:00
Mario Zechner
09e9de5749 fix(tui): stop heading underline leaking into padding 2026-03-31 22:40:20 +02:00
Mario Zechner
a1e107897d fix(tui): await async slash command completions closes #2719 2026-03-31 14:41:50 +02:00
Mario Zechner
8c64058809 fix(tui): normalize keypad functional keys closes #2650 2026-03-29 21:53:31 +02:00
Mario Zechner
49c0d860a4 fix(tui): stop swallowing escape during cell size detection closes #2661 2026-03-29 13:22:23 +02:00
Mario Zechner
0406b41a46 fix(tui): keep @ autocomplete responsive in large trees closes #1278 2026-03-26 15:43:51 +01:00
Mario Zechner
cb4e4d8c9a fix(tui): reset viewport state after shrink 2026-03-26 10:40:10 +01:00
Mario Zechner
21950c5ba4 fix(tui): stop chaining slash arg autocomplete after Tab closes #2577 2026-03-24 23:52:48 +01:00
Mario Zechner
7f04694c4d chore(tui): apply import ordering in terminal 2026-03-24 20:17:25 +01:00
Duncan Ogilvie
9a0be024a6 feat(tui): PI_TUI_WRITE_LOG now accepts a directory path (#2508)
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-03-24 00:22:24 +01:00
Mario Zechner
4c7df25d03 fix(tui): restore blockquote styling after inline links
The quoteInlineStyleContext used an empty stylePrefix, so after inline
elements (links, bold, code) closed their ANSI codes inside a blockquote,
the quote color was not re-applied. Text following a link rendered in
default foreground instead of the quote theme color.
2026-03-23 22:53:24 +01:00
Mario Zechner
ab771a84b2 fix(tui): preserve heading styling after inline code spans
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.
2026-03-23 01:07:38 +01:00
Mario Zechner
77db2e4c18 fix(tui): stream truncateToWidth for large strings closes #2447 2026-03-21 10:06:29 +01:00
Mario Zechner
16937947be fix(tui): skip Termux height redraws closes #2467 2026-03-20 19:35:50 +01:00
Mario Zechner
6de8a2570b fix(tui): stop evicting unrelated default keybindings closes #2455 2026-03-20 12:54:20 +01:00
Mario Zechner
e3fee7a511 fix(keybindings): migrate to namespaced ids closes #2391 2026-03-20 01:55:30 +01:00
Mario Zechner
fa877de1fb fix(tui): resolve raw backspace ambiguity closes #2293 2026-03-18 00:48:03 +01:00
Sviatoslav Abakumov
fa26f15e68 fix(tui): clear stale scrollback on session switch (#2155)
fullRender wrote \x1b[3J\x1b[2J\x1b[H (clear scrollback, then clear
screen). But \x1b[2J pushes on-screen content into scrollback, undoing
the preceding \x1b[3J. Reorder to \x1b[2J\x1b[H\x1b[3J so the screen is
cleared first and scrollback is wiped last.
2026-03-14 16:00:34 +01:00
Markus Ylisiurunen
962c12444d fix(tui): remove trailing markdown block spacing (#2152) 2026-03-14 15:50:19 +01:00
Markus Ylisiurunen
c9a3d14aa5 feat(tui): make select list column sizing configurable (#2154)
* feat(tui): make select list layout configurable

* feat(tui): tune select list column sizing

* test(tui): fix select list alignment assertions
2026-03-14 15:50:00 +01:00
badlogic
4f81c3c28d fix(coding-agent,tui): stabilize windows shell/path handling
fixes #1775

fixes #1769
2026-03-14 05:36:21 +01:00
Mario Zechner
ad32089f0c fix(tui): preserve literal paste content closes #2064 2026-03-14 04:34:40 +01:00
Mario Zechner
acb0f4d807 fix(tui): preserve ./ prefix in tab completion, closes #2087 2026-03-14 04:12:38 +01:00
Mario Zechner
9c0ba357ad fix(tui): distinguish ctrl+backspace from backspace on Windows Terminal
0x08 (BS) was treated as plain backspace alongside 0x7f (DEL). On
Windows Terminal, Backspace sends 0x7f and Ctrl+Backspace sends 0x08,
making ctrl+backspace bindings unreachable.

Now 0x08 matches ctrl+backspace (and ctrl+h, same byte) but not plain
backspace. 0x7f remains plain backspace.

fixes #2139
2026-03-14 03:58:28 +01:00
xu0o0
bd2c3ab67e feat(tui): treat paste markers as atomic segments in editor (#2111)
* feat(tui): treat paste markers as atomic segments in editor

Paste markers like `[paste #1 +123 lines]` are now treated as single
atomic units for cursor movement, word navigation, deletion, and
wrapping. Only markers with valid paste IDs (present in the editor's
pastes Map) are treated atomically.

* fix(tui): word-wrap oversized atomic segments in editor
2026-03-13 17:42:59 +01:00
xu0o0
adce496f63 fix(tui): handle narrow terminal width in editor scroll indicator (#2103) 2026-03-13 17:41:14 +01:00
xu0o0
b6b7fafddb fix(tui): normalize tabs in editor setText and input paths (#2027) 2026-03-12 23:48:15 +00:00