Commit graph

220 commits

Author SHA1 Message Date
Armin Ronacher
583f153d50 fix(tui): normalize source filenames 2026-08-01 14:38:13 +02:00
Armin Ronacher
af187eee4b fix(tui): clip Kitty images to layout boundaries 2026-07-31 17:49:05 +02:00
Armin Ronacher
6129a353b1 feat(tui): add configurable fullscreen scrollbars 2026-07-31 17:17:02 +02:00
Armin Ronacher
bf4a90d819 fix(tui): preserve spaces in settings searches 2026-07-31 16:34:27 +02:00
Armin Ronacher
3c717842e8 feat(tui): add fullscreen transcript navigation 2026-07-31 16:23:58 +02:00
Armin Ronacher
696a828a4d fix(tui): prevent phantom alt-screen selections 2026-07-31 15:13:53 +02:00
Armin Ronacher
8ac92f831c feat(tui): add draggable transient scrollbars 2026-07-31 15:02:52 +02:00
Armin Ronacher
17090d4b99
feat(tui): add stacked alt-screen flashes (#7361) 2026-07-31 10:13:31 +02:00
David Brailovsky
3c5a1b2393 fix(tui): reduce default mouse wheel scroll speed 2026-07-31 09:53:33 +02:00
Mario Zechner
ea1e77e2db feat(tui): add alternate-screen viewport layouts 2026-07-31 09:22:10 +02:00
Alexey Zaytsev
714978bf51
Markdown api (#7231)
* feat(tui): export bundled Marked parser

* feat(coding-agent): add width-aware Markdown transformers

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-30 22:39:04 +02:00
Petr Houška
dfe47d3fbd
fix(tui): align grapheme widths with terminal cells (#6987)
Intl.Segmenter can group Indic conjuncts and spacing marks into one grapheme even when wcwidth-style terminals allocate multiple cells. Count visible consonants after marks and Unicode spacing marks separately while preserving zero-width exceptions.

This is a compatibility heuristic. Unicode Spacing_Mark indicates positive advance, not a full terminal cell; Kitty keeps many Indic continuations in the initial cell, while xterm-style terminals advance for them, so Pi overcounts some clusters in Kitty.

Overcounting causes horizontal drift, but undercounting can trigger terminal autowrap, so this change favors overcounting.

Clusters can contain repeated marks and mark-consonant continuations, so this implementation leaves their widths uncapped. Collapsing them would undercount terminals that advance for every visible continuation.

Mode 2027 does not report cluster widths, so Pi still needs local width calculations. This change does not implement OSC 66, which would be preferable where supported.

Fixes #6124

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-30 22:25:46 +02:00
Mario Zechner
c13ffe1877 feat(tui): add alternate-screen renderer
Closes #7304
2026-07-30 12:59:48 +02:00
Armin Ronacher
44b26c9b44 fix(tui): format image fallback changes 2026-07-30 00:20:32 +02:00
Mario Zechner
fb4ecd633e
fix(tui): shorten image fallback paths and clamp width (#7262)
Image.render() previously emitted the imageFallback line without
truncateToWidth. Long absolute paths (common when callers pass a
filename) exceeded the terminal width and crashed the TUI.

- imageFallback: home-shorten paths to ~/...; OSC 8 file:// link when
  hyperlinks are available and the path is absolute
- Image.render: truncate fallback lines to the render width
- tests for shorten, hyperlink, basename, and width clamp

Co-authored-by: Moritz Hofmann <Moritz.Hofmann@aimentum.de>
2026-07-29 10:27:12 +02:00
Christian Klotz
37bedb7f0b
fix(tui): truncate narrow editor scroll indicators (#7015)
Fixes #6962
2026-07-23 20:47:11 +02:00
David Brailovsky
fe42ba5b38
write tui debug/crash logs into the configured pi agent dir (#6958)
fixes #6652
2026-07-22 15:48:25 +02:00
Mario Zechner
3595e080cb fix(tui): keep paste registry in sync when deleting paste markers
Undo snapshots now restore paste content and counters alongside editor text. Paste marker renumbering shifts registry entries in ascending ID order before rewriting markers, preventing literal or incorrect paste content on submit.\n\nCloses #6844
2026-07-20 14:04:21 +02:00
Xiangzhe
00b032676f
fix(tui): handle CRLF and CR line endings (#6764) 2026-07-17 09:01:10 +02:00
Xiangzhe
1c799cecd0
fix(tui): normalize tabs for terminal output (#6697) 2026-07-16 09:17:05 +02:00
Rafał Krzyważnia
8479bd8474
fix(tui): parse legacy alt-prefixed symbols (#6523)
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-07-11 15:20:08 +02:00
Armin Ronacher
f2e9d75388 fix(coding-agent): preserve backslash escapes in user messages
closes #6105
2026-06-27 19:24:14 +02:00
Armin Ronacher
3b56134694 fix(tui): bind ctrl+j as newline by default 2026-06-22 13:57:02 +02:00
Alexey Zaytsev
3095977d13
fix(tui): stabilize streaming code fence rendering (#5846) 2026-06-20 14:58:30 +02:00
Armin Ronacher
d0b46764b1
feat(coding-agent): add automatic theme mode (#5874) 2026-06-18 17:13:47 +02:00
Diego de Oliveira
7a14325b24
feat(tui): detect Warp terminal and enable Kitty image protocol (#5841)
Some checks are pending
CI / build-check-test (push) Waiting to run
Warp supports the Kitty graphics protocol and OSC 8 hyperlinks,
but pi's terminal-image capability detection did not recognize it.
Add detection via TERM_PROGRAM=WarpTerminal, WARP_SESSION_ID,
and WARP_TERMINAL_SESSION_UUID so images render inline without
requiring the TERM_PROGRAM=kitty workaround.

Fixes #5827
2026-06-18 10:45:51 +02:00
4h9fbZ
3039f3e17d
fix(tui): restore cursorUp start-of-line jump when input is non-empty (#5789) 2026-06-16 15:14:17 +02:00
Armin Ronacher
24053eab66 fix(tui): update tab overlay boundary expectation 2026-06-15 01:12:40 +02:00
Armin Ronacher
5b6058c3a7 fix(tui): align overlays over CJK wide cells
closes #5297
2026-06-15 01:06:15 +02:00
Armin Ronacher
93b3b7c1fe fix(tui): preserve WezTerm Kitty images on full redraw
Reserve visible Kitty image rows before drawing placements in full redraws, while preserving the first-row path for taller-than-viewport images so #4415 stays fixed.

Closes #5618.
2026-06-14 23:16:59 +02:00
Vegard Stikbakke
f0989800cb
feat: detect first-run terminal theme (#5385)
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-06-14 07:14:42 +02:00
Armin Ronacher
17721d5e01 fix(tui): preserve unordered user list markers (closes #5657) 2026-06-12 20:22:53 +02:00
Armin Ronacher
0caca6cf3f fix(tui): support slash-separated fuzzy filter tokens 2026-06-12 18:24:55 +02:00
Armin Ronacher
1c24336560 fix(tui): keep WezTerm Kitty images visible
Closes #5618.
2026-06-12 12:59:32 +02:00
Sviatoslav Abakumov
dfd4571cb0
fix(tui): separate list items with blank lines in loose lists 2026-06-09 23:53:18 +04:00
Mario Zechner
b7e721cb38 feat(tui): support autocomplete trigger characters
closes #4703
2026-06-09 14:15:39 +02:00
Mario Zechner
e4907b3b09 fix(tui): restore prompt draft after history browsing
closes #5494
2026-06-09 13:06:13 +02:00
Mario Zechner
8da077bcca fix(tui): wrap CJK text at grapheme boundaries
closes #5495
2026-06-09 12:52:52 +02:00
Mario Zechner
21917fed37
Merge pull request #5499 from Roman-Galeev/fix/editor-cursor-move-refresh-autocomplete
fix(tui): re-query autocomplete picker on cursor movement
2026-06-08 13:13:05 +02:00
Mario Zechner
718215bd95 feat(coding-agent): add extension project trust decisions 2026-06-08 12:59:08 +02:00
Roman Galeev
9d007fe642 fix(tui): re-query autocomplete picker on cursor movement
moveCursor() repositioned the cursor but never called updateAutocomplete()
or cancelAutocomplete(), unlike insertCharacter()/handleBackspace(). So an
open autocomplete picker went stale when the cursor moved: e.g. typing
`/cmd ` (argument menu open) then arrowing Left back into the command name
left the argument list showing against a `/cmd` prefix, and a Tab there
concatenated the stale suggestion onto the partial command name
(e.g. `/swarepo`).

Sync the picker at the end of moveCursor(): when a picker is open, re-query
via updateAutocomplete(), which refreshes the list for the new cursor
position or closes it when nothing matches.

Adds a regression test in test/editor.test.ts (verified to fail without the
fix). Fixes earendil-works/pi#5496.
2026-06-08 10:57:50 +02:00
Mario Zechner
130ae577ac fix(tui,coding-agent): make keyboard protocol fallback response-driven
Some checks are pending
CI / build-check-test (push) Waiting to run
closes #5188
2026-06-07 17:04:19 +02:00
Mario Zechner
59d7025668 fix(tui): position cursor for prompt history navigation
closes #5454
2026-06-07 10:56:09 +02:00
Mario Zechner
13898f048f Fix TUI tab width accounting
closes #5218
2026-06-02 13:54:47 +02:00
Nico Bailon
91a2f86600 fix(tui): harden overlay focus restoration 2026-05-31 21:20:33 -07:00
Nico Bailon
735ccbd00f fix(tui): release overlay focus to explicit targets
Add an explicit overlay unfocus target so callers can move input to the editor or another component while overlays remain visible. Align fallback overlay focus with visual focus order and cover blocked replacement release, null targets, and multi-overlay cycling.
2026-05-30 13:29:36 -07:00
Nico Bailon
5d9b28ee43 fix(tui): keep focused overlays interactive after UI
Preserve a focused visible overlay as the input owner across extension custom UI replacement, while letting the replacement receive and close its own input before focus is restored. Fixes #5129.
2026-05-30 13:29:36 -07:00
Marek Pazik
9d2bceba5d fix(tui): forward OSC 8 hyperlinks under tmux when the client supports them
detectCapabilities previously disabled hyperlinks under tmux unconditionally. tmux re-emits OSC 8 to the outer terminal only when the attached client advertises the 'hyperlinks' feature in client_termfeatures, and strips them otherwise.

Probe the running server with 'tmux display-message -p #{client_termfeatures}' and enable hyperlinks only when the feature is listed. The probe fails closed: any error (no tmux/server, timeout, old tmux) yields false. images stays null; only the hyperlink decision changed. The probe is injected into detectCapabilities so it stays testable without spawning a process.
2026-05-29 22:02:25 +10:00
Armin Ronacher
99aec8e02b test(tui): reduce keyboard negotiation coverage 2026-05-27 23:03:13 +02:00
Armin Ronacher
6ab62a06d7 fix(tui): harden keyboard protocol negotiation 2026-05-27 22:23:39 +02:00