@oh-my-pi/pi-tui 12.17.0 → 12.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +527 -0
  2. package/package.json +53 -50
  3. package/src/tui.ts +3 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,527 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [12.18.0] - 2026-02-21
6
+ ### Fixed
7
+
8
+ - Fixed viewport synchronization issue by clearing scrollback when terminal state becomes desynced during full re-renders
9
+
10
+ ## [12.12.2] - 2026-02-19
11
+
12
+ ### Fixed
13
+
14
+ - Fixed non-forced full re-renders clearing terminal scrollback history during streaming updates by limiting scrollback clears to explicit forced re-renders.
15
+
16
+ ## [12.12.0] - 2026-02-19
17
+
18
+ ### Added
19
+
20
+ - Added PageUp/PageDown navigation for editor content and autocomplete selection to jump across long wrapped inputs faster.
21
+
22
+ ### Fixed
23
+
24
+ - Fixed history-entry navigation anchoring (Up opens at top, Down opens at bottom) and preserved editor scroll context when max-height changes to keep cursor movement visible in long prompts ([#99](https://github.com/can1357/oh-my-pi/issues/99)).
25
+
26
+ ## [12.11.3] - 2026-02-19
27
+
28
+ ### Fixed
29
+
30
+ - Fixed differential deleted-line rendering when content shrinks to empty so stale first-row content is cleared reliably.
31
+ - Fixed incremental stale-row clearing to use erase-below semantics in synchronized output, reducing leftover-line artifacts after shrink operations.
32
+
33
+ ## [12.9.0] - 2026-02-17
34
+ ### Added
35
+
36
+ - Exported `getTerminalId()` function to get a stable identifier for the current terminal, with support for TTY device paths and terminal multiplexers
37
+ - Exported `getTtyPath()` function to resolve the TTY device path for stdin via POSIX `ttyname(3)`
38
+
39
+ ## [12.5.0] - 2026-02-15
40
+ ### Added
41
+
42
+ - Added `cursorOverride` and `cursorOverrideWidth` properties to customize the end-of-text cursor glyph with ANSI-styled strings
43
+ - Added `getUseTerminalCursor()` method to query the terminal cursor mode setting
44
+
45
+ ## [11.10.0] - 2026-02-10
46
+ ### Added
47
+
48
+ - Added `hint` property to autocomplete items to display dim ghost text after cursor when item is selected
49
+ - Added `getInlineHint()` method to `SlashCommand` interface for providing inline hint text based on argument state
50
+ - Added `getInlineHint()` method to `AutocompleteProvider` interface for displaying dim ghost text after cursor
51
+ - Added `hintStyle` theme option to customize styling of inline hint/ghost text in editor
52
+
53
+ ### Changed
54
+
55
+ - Updated editor to render inline hint text as dim ghost text after cursor when autocomplete suggestions are active or provider supplies hints
56
+
57
+ ## [11.8.0] - 2026-02-10
58
+ ### Added
59
+
60
+ - Added Alt+Y keybinding to cycle through kill ring entries (yank-pop)
61
+ - Added undo support to Input component with Ctrl+Z keybinding
62
+ - Added kill ring support to Input component for Emacs-style kill/yank operations
63
+ - Added yank (Ctrl+Y) and yank-pop (Alt+Y) support to Input component
64
+
65
+ ### Changed
66
+
67
+ - Changed Editor kill ring implementation to use dedicated KillRing class for better state management
68
+ - Changed Editor undo stack to use generic UndoStack class with automatic state cloning
69
+ - Changed kill/yank behavior to properly accumulate consecutive kill operations
70
+ - Changed Input component deletion methods to record killed text in kill ring
71
+ - Changed undo coalescing in Input component to group consecutive word typing into single undo units
72
+
73
+ ## [11.4.1] - 2026-02-06
74
+ ### Fixed
75
+
76
+ - Fixed terminal scrolling when displaying overlays after rendering large content, preventing hundreds of blank lines from being output
77
+
78
+ ## [11.3.0] - 2026-02-06
79
+
80
+ ### Breaking Changes
81
+
82
+ - Removed `getCursorPosition()` method from Component interface and implementations, eliminating hardware cursor positioning support
83
+
84
+ ### Added
85
+
86
+ - Added sticky column behavior for vertical cursor movement, preserving target column when navigating through lines of varying lengths
87
+ - Added `drainInput()` method to Terminal interface to prevent Kitty key release events from leaking to parent shell over slow SSH connections
88
+ - Added `setClearOnShrink()` method to control whether full re-render occurs when content shrinks below working area
89
+ - Added support for hidden paths (e.g., `.pi`, `.github`) in autocomplete while excluding `.git` directories
90
+
91
+ ### Changed
92
+
93
+ - Changed default value of `PI_HARDWARE_CURSOR` environment variable from implicit true to explicit `"1"` for clarity
94
+ - Changed default value of `PI_CLEAR_ON_SHRINK` environment variable from implicit false to explicit `"0"` for clarity
95
+ - Changed TUI to clear screen on startup to prevent shell prompts and status messages from bleeding into the first rendered frame
96
+ - Refactored full-render logic into reusable helper function to reduce code duplication across multiple render paths
97
+ - Changed autocomplete to include hidden paths but filter out `.git` and its contents
98
+ - Changed Input component to properly handle surrogate pairs in Unicode text, preventing cursor display corruption with emoji and multi-byte characters
99
+ - Changed Editor to use `setCursorCol()` for all cursor column updates, enabling sticky column tracking
100
+ - Changed Editor's vertical navigation to implement sticky column logic via `moveToVisualLine()` and `computeVerticalMoveColumn()`
101
+ - Changed Editor's Enter key handling to extract submit logic into `submitValue()` method for better code organization
102
+ - Changed SettingsList to truncate long lines to viewport width, preventing text overflow
103
+ - Changed Terminal's `stop()` method to drain stdin before restoring raw mode, fixing race condition where Ctrl+D could close parent shell over SSH
104
+ - Changed TUI rendering to add `clearOnShrink` option (controlled by `PI_CLEAR_ON_SHRINK` env var) for reducing redraws on slower terminals
105
+ - Changed TUI rendering to detect when extra lines exceed viewport height and trigger full re-render instead of incremental updates
106
+
107
+ ### Fixed
108
+
109
+ - Fixed rendering of extra blank lines when content shrinks by improving cursor positioning logic during line deletion
110
+ - Fixed cursor display position in Input component when scrolling horizontally through long text
111
+ - Fixed Kitty keyboard protocol disable sequence to use safe write method, preventing potential output buffering issues
112
+ - Fixed unnecessary full-screen redraws when changes occur in out-of-view components (e.g., spinners), reducing terminal scroll events and improving performance on slower connections
113
+ - Fixed scrollback clearing behavior to only clear screen instead of scrollback when resizing or shrinking content, preventing loss of terminal history
114
+ - Fixed `.git` directory appearing in autocomplete suggestions when filtering by prefix
115
+ - Fixed cursor position corruption in Input component when displaying text with emoji and combining characters
116
+ - Fixed `.git` directory appearing in autocomplete suggestions
117
+ - Fixed race condition where Kitty key release events could leak to parent shell after TUI exit over slow SSH connections
118
+ - Fixed Editor's word movement (Ctrl+Left/Right) to properly reset sticky column for subsequent vertical navigation
119
+ - Fixed Editor's undo operation to reset sticky column state when restoring cursor position
120
+ - Fixed Editor's right arrow key at end of last line to set sticky column for subsequent up/down navigation
121
+ - Fixed TUI rendering to correctly detect viewport changes and avoid false full-redraws after content shrinks
122
+ - Fixed Kitty protocol key parsing to prefer codepoint over base layout for Latin letters and symbols, fixing keyboard layout issues (e.g., Dvorak)
123
+
124
+ ## [11.0.0] - 2026-02-05
125
+
126
+ ### Added
127
+
128
+ - Introduced `terminal-capabilities.ts` module consolidating terminal detection and image protocol support
129
+ - Added `TerminalInfo` class with methods for detecting image lines and formatting notifications
130
+ - Added `NotifyProtocol` enum supporting Bell, OSC 99, and OSC 9 notification protocols
131
+ - Added `isNotificationSuppressed()` function to check `OMP_NOTIFICATIONS` environment variable
132
+ - Added `TERMINAL` constant providing detected terminal capabilities at runtime
133
+
134
+ ### Changed
135
+
136
+ - Changed notification suppression environment variable from `OMP_NOTIFICATIONS` to `PI_NOTIFICATIONS`
137
+ - Changed TUI write log environment variable from `OMP_TUI_WRITE_LOG` to `PI_TUI_WRITE_LOG`
138
+ - Changed hardware cursor environment variable from `OMP_HARDWARE_CURSOR` to `PI_HARDWARE_CURSOR`
139
+ - Updated environment variable access to use `getEnv()` utility function from `@oh-my-pi/pi-utils` for consistent handling
140
+ - Renamed `TERMINAL_INFO` export to `TERMINAL` for clearer API semantics
141
+ - Reorganized terminal image exports from `terminal-image` to `terminal-capabilities` module
142
+ - Updated all internal references to use `TERMINAL` instead of `TERMINAL_INFO`
143
+
144
+ ### Removed
145
+
146
+ - Removed `terminal-image` module exports from public API (functionality migrated to `terminal-capabilities`)
147
+
148
+ ## [10.5.0] - 2026-02-04
149
+
150
+ ### Fixed
151
+
152
+ - Treated inline image lines with cursor-move prefixes as image sequences to prevent width overflow crashes
153
+
154
+ ## [9.8.0] - 2026-02-01
155
+
156
+ ### Changed
157
+
158
+ - Moved `wrapTextWithAnsi` export to `@oh-my-pi/pi-natives` package
159
+
160
+ ### Fixed
161
+
162
+ - Improved Kitty terminal key sequence parsing to correctly handle text field codepoints in CSI-u sequences
163
+ - Fixed handling of private use Unicode codepoints (U+E000 to U+F8FF) in Kitty key decoding to prevent invalid character interpretation
164
+
165
+ ## [9.7.0] - 2026-02-01
166
+ ### Breaking Changes
167
+
168
+ - Removed `Key` helper object from public API; use string literals like `"ctrl+c"` instead of `Key.ctrl("c")`
169
+ - Removed `KeyEventType` export from public API
170
+
171
+ ### Changed
172
+
173
+ - Migrated key parsing and matching logic to native implementation for improved performance
174
+ - Simplified `isKeyRelease()` and `isKeyRepeat()` to use regex pattern matching instead of string inclusion checks
175
+
176
+ ## [9.6.2] - 2026-02-01
177
+ ### Changed
178
+
179
+ - Renamed `EllipsisKind` enum to `Ellipsis` for clearer API naming
180
+ - Changed hardcoded ellipsis character from theme-configurable to literal "…" in editor truncation
181
+ - Refactored `visibleWidth` function to use caching wrapper around new `visibleWidthRaw` implementation for improved performance
182
+
183
+ ### Removed
184
+
185
+ - Removed `truncateToWidth`, `sliceWithWidth`, and `extractSegments` functions from public API (now re-exported directly from @oh-my-pi/pi-natives)
186
+ - Removed `ellipsis` property from `SymbolTheme` interface
187
+ - Removed `extractAnsiCode` function from public API
188
+
189
+ ## [9.6.1] - 2026-02-01
190
+ ### Changed
191
+
192
+ - Improved performance of key ID parsing with optimized cache lookup strategy
193
+ - Simplified `visibleWidth` calculation to use consistent Bun.stringWidth approach for all string lengths
194
+
195
+ ### Removed
196
+
197
+ - Removed `visibleWidth` benchmark file in favor of Kitty sequence benchmarking
198
+
199
+ ## [9.5.0] - 2026-02-01
200
+ ### Changed
201
+
202
+ - Improved fuzzy file search performance by using native implementation instead of spawning external process
203
+ - Replaced external `fd` binary with native fuzzy path search for `@`-prefixed autocomplete
204
+
205
+ ## [9.4.0] - 2026-01-31
206
+ ### Added
207
+
208
+ - Exported `padding` utility function for creating space-padded strings efficiently
209
+
210
+ ### Changed
211
+
212
+ - Optimized padding operations across all components to use pre-allocated space buffer for better performance
213
+
214
+ ## [9.2.2] - 2026-01-31
215
+
216
+ ### Added
217
+ - Added setAutocompleteMaxVisible() configuration (3-20 items)
218
+ - Added image detection to terminal capabilities (containsImage method)
219
+ - Added stdin monitoring to detect stalled input events and log warnings
220
+
221
+ ### Changed
222
+ - Improved blockquote rendering with text wrapping in Markdown component
223
+ - Restructured terminal capabilities from interface-based to class-based model
224
+ - Improved table column width calculation with word-aware wrapping
225
+ - Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
226
+
227
+ ### Fixed
228
+ - Simplified terminal write error handling to mark terminal as dead on any write failure
229
+ - Fixed multi-line strings in renderOutputBlock causing width overflow
230
+ - Fixed slash command autocomplete applying stale completion when typing quickly
231
+
232
+ ### Removed
233
+ - Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
234
+
235
+ ## [8.12.7] - 2026-01-29
236
+
237
+ ### Fixed
238
+ - Fixed slash command autocomplete applying stale completion when typing quickly
239
+
240
+ ## [8.4.1] - 2026-01-25
241
+
242
+ ### Added
243
+ - Added fuzzy match function for autocomplete suggestions
244
+ ## [8.4.0] - 2026-01-25
245
+
246
+ ### Changed
247
+ - Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
248
+
249
+ ### Fixed
250
+ - Terminal gracefully handles write failures by marking dead instead of exiting the process
251
+ - Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
252
+ - Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
253
+ ## [8.2.0] - 2026-01-24
254
+
255
+ ### Added
256
+ - Added mermaid diagram rendering engine (renderMermaidToPng) with mmdc CLI integration
257
+ - Added terminal graphics encoding (iTerm2/Kitty) for mermaid diagrams with automatic width scaling
258
+ - Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)
259
+
260
+ ### Changed
261
+ - Updated TypeScript configuration for better publish-time configuration handling with tsconfig.publish.json
262
+ - Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
263
+ - Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
264
+
265
+ ### Fixed
266
+ - Fixed crash when terminal becomes unavailable (EIO errors) by exiting gracefully instead of throwing
267
+ - Fixed potential errors during emergency terminal restore when terminal is already dead
268
+ - Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
269
+ ## [6.8.3] - 2026-01-21
270
+ ### Added
271
+
272
+ - Added undo support in the editor via `Ctrl+-`
273
+ - Added `Alt+Delete` as a delete-word-forward shortcut
274
+ - Added configurable code block indentation for Markdown rendering
275
+ - Added undo support in the editor via `Ctrl+-`.
276
+ - Added configurable code block indentation for Markdown rendering.
277
+ - Added `Alt+Delete` as a delete-word-forward shortcut.
278
+
279
+ ### Changed
280
+
281
+ - Improved fuzzy matching to handle alphanumeric swaps
282
+ - Normalized keybinding definitions to lowercase internally
283
+ - Improved fuzzy matching to handle alphanumeric swaps.
284
+ - Normalized keybinding definitions to lowercase internally.
285
+
286
+ ### Fixed
287
+
288
+ - Added legacy terminal support for `Ctrl+` symbol key combinations
289
+ - Added legacy terminal support for `Ctrl+` symbol key combinations.
290
+
291
+ ## [6.8.1] - 2026-01-20
292
+
293
+ ### Fixed
294
+
295
+ - Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
296
+
297
+ ## [5.6.7] - 2026-01-18
298
+
299
+ ### Added
300
+
301
+ - Added configurable editor padding via `editorPaddingX` theme option
302
+ - Added `setMaxHeight()` method to limit editor height with scrolling
303
+ - Added Emacs-style kill ring for text deletion operations
304
+ - Added `Alt+D` keybinding to delete words forward
305
+ - Added `Ctrl+Y` keybinding to yank from kill ring
306
+ - Added `waitForRender()` method to await pending renders
307
+ - Added Focusable interface and hardware cursor marker support for IME positioning
308
+ - Added support for shifted symbol keys in keybindings
309
+
310
+ ### Changed
311
+
312
+ - Updated tab bar rendering to wrap text across multiple lines when content exceeds available width
313
+ - Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
314
+ - Improved cursor positioning with safer bounds checking
315
+ - Updated editor layout to respect configurable padding
316
+ - Refactored scrolling logic for better viewport management
317
+
318
+ ### Fixed
319
+
320
+ - Fixed key detection for shifted symbol characters
321
+ - Fixed backspace handling with additional codepoint support
322
+ - Fixed Alt+letter key combinations for better recognition
323
+
324
+ ## [5.3.1] - 2026-01-15
325
+ ### Fixed
326
+
327
+ - Fixed rendering issues on Windows by preventing re-entrant renders
328
+
329
+ ## [5.1.0] - 2026-01-14
330
+
331
+ ### Added
332
+
333
+ - Added `pageUp` and `pageDown` key support with `selectPageUp`/`selectPageDown` editor actions
334
+ - Added `isPageUp()` and `isPageDown()` helper functions
335
+ - Added `SizeValue` type for CSS-like overlay sizing (absolute or percentage strings like `"50%"`)
336
+ - Added `OverlayHandle` interface with `hide()`, `setHidden()`, `isHidden()` methods for overlay visibility control
337
+ - Added `visible` callback to `OverlayOptions` for dynamic visibility based on terminal dimensions
338
+ - Added `pad` parameter to `truncateToWidth()` for padding result with spaces to exact width
339
+
340
+ ### Changed
341
+
342
+ - Changed `OverlayOptions` to use `SizeValue` type for `width`, `maxHeight`, `row`, and `col` properties
343
+ - Changed `showOverlay()` to return `OverlayHandle` for controlling overlay visibility
344
+ - Removed `widthPercent`, `maxHeightPercent`, `rowPercent`, `colPercent` from `OverlayOptions` (use percentage strings instead)
345
+
346
+ ### Fixed
347
+
348
+ - Fixed numbered list items showing "1." for all items when code blocks break list continuity
349
+ - Fixed width overflow protection in overlay compositing to prevent TUI crashes
350
+
351
+ ## [4.7.0] - 2026-01-12
352
+
353
+ ### Fixed
354
+ - Remove trailing space padding from Text, Markdown, and TruncatedText components when no background color is set (fixes copied text including unwanted whitespace)
355
+
356
+ ## [4.6.0] - 2026-01-12
357
+
358
+ ### Added
359
+ - Add fuzzy matching module (`fuzzyMatch`, `fuzzyFilter`) for command autocomplete
360
+ - Add `getExpandedText()` to editor for expanding paste markers
361
+ - Add backslash+enter newline fallback for terminals without Kitty protocol
362
+
363
+ ### Fixed
364
+ - Remove Kitty protocol query timeout that caused shift+enter delays
365
+ - Add bracketed paste check to prevent false key release/repeat detection
366
+ - Rendering optimizations: only re-render changed lines
367
+ - Refactor input component to use keybindings manager
368
+
369
+ ## [4.4.4] - 2026-01-11
370
+ ### Fixed
371
+
372
+ - Fixed Ctrl+Enter sequences to insert new lines in the editor
373
+
374
+ ## [4.2.1] - 2026-01-11
375
+ ### Changed
376
+
377
+ - Improved file autocomplete to show directory listing when typing `@` with no query, and fall back to prefix matching when fuzzy search returns no results
378
+
379
+ ### Fixed
380
+
381
+ - Fixed editor redraw glitch when canceling autocomplete suggestions
382
+ - Fixed `fd` tool detection to automatically find `fd` or `fdfind` in PATH when not explicitly configured
383
+
384
+ ## [4.1.0] - 2026-01-10
385
+ ### Added
386
+
387
+ - Added persistent prompt history storage support via `setHistoryStorage()` method, allowing history to be saved and restored across sessions
388
+
389
+ ## [4.0.0] - 2026-01-10
390
+ ### Added
391
+
392
+ - `EditorComponent` interface for custom editor implementations
393
+ - `StdinBuffer` class to split batched stdin into individual sequences
394
+ - Overlay compositing via `TUI.showOverlay()` and `TUI.hideOverlay()` for `ctx.ui.custom()` with `{ overlay: true }`
395
+ - Kitty keyboard protocol flag 2 support for key release events (`isKeyRelease()`, `isKeyRepeat()`, `KeyEventType`)
396
+ - `setKittyProtocolActive()`, `isKittyProtocolActive()` for Kitty protocol state management
397
+ - `kittyProtocolActive` property on Terminal interface to query Kitty protocol state
398
+ - `Component.wantsKeyRelease` property to opt-in to key release events (default false)
399
+ - Input component `onEscape` callback for handling escape key presses
400
+
401
+ ### Changed
402
+
403
+ - Terminal startup now queries Kitty protocol support before enabling event reporting
404
+ - Default editor `newLine` binding now uses `shift+enter` only
405
+
406
+ ### Fixed
407
+
408
+ - Key presses no longer dropped when batched with other events over SSH
409
+ - TUI now filters out key release events by default, preventing double-processing of keys
410
+ - `matchesKey()` now correctly matches Kitty protocol sequences for unmodified letter keys
411
+ - Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
412
+
413
+ ## [3.32.0] - 2026-01-08
414
+
415
+ ### Fixed
416
+
417
+ - Fixed text wrapping allowing long whitespace tokens to exceed line width
418
+
419
+ ## [3.20.0] - 2026-01-06
420
+ ### Added
421
+
422
+ - Added `isCapsLock` helper function for detecting Caps Lock key press via Kitty protocol
423
+ - Added `isCtrlY` helper function for detecting Ctrl+Y keyboard input
424
+ - Added configurable editor keybindings with typed key identifiers and action matching
425
+ - Added word-wrapped editor rendering for long lines
426
+
427
+ ### Changed
428
+
429
+ - Settings list descriptions now wrap to the available width instead of truncating
430
+
431
+ ### Fixed
432
+
433
+ - Fixed Shift+Enter detection in legacy terminals that send ESC+CR sequence
434
+
435
+ ## [3.15.1] - 2026-01-05
436
+
437
+ ### Fixed
438
+
439
+ - Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
440
+
441
+ ## [3.15.0] - 2026-01-05
442
+
443
+ ### Added
444
+
445
+ - Added `inputCursor` symbol for customizing the text input cursor character
446
+ - Added `symbols` property to `EditorTheme`, `MarkdownTheme`, and `SelectListTheme` interfaces for component-level symbol customization
447
+ - Added `SymbolTheme` interface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters
448
+ - Added support for custom spinner frames in the Loader component
449
+
450
+ ## [3.9.1337] - 2026-01-04
451
+ ### Added
452
+
453
+ - Added `setTopBorder()` method to Editor component for displaying custom status content in the top border
454
+ - Added `getWidth()` method to TUI class for retrieving terminal width
455
+ - Added rounded corner box-drawing characters to Editor component borders
456
+
457
+ ### Changed
458
+
459
+ - Changed Editor component to use proper box borders with vertical side borders instead of horizontal-only borders
460
+ - Changed cursor style from block to thin blinking bar (▏) at end of line
461
+
462
+ ## [1.500.0] - 2026-01-03
463
+ ### Added
464
+
465
+ - Added `getText()` method to Text component for retrieving current text content
466
+
467
+ ## [1.337.1] - 2026-01-02
468
+
469
+ ### Added
470
+
471
+ - TabBar component for horizontal tab navigation
472
+ - Emergency terminal restore to prevent corrupted state on crashes
473
+ - Overhauled UI with welcome screen and powerline footer
474
+ - Theme-configurable HTML export colors
475
+ - `ctx.ui.theme` getter for styling status text with theme colors
476
+
477
+ ### Changed
478
+
479
+ - Forked to @oh-my-pi scope with unified versioning across all packages
480
+
481
+ ### Fixed
482
+
483
+ - Strip OSC 8 hyperlink sequences in `visibleWidth()`
484
+ - Crash on Unicode format characters in `visibleWidth()`
485
+ - Markdown code block syntax highlighting
486
+
487
+ ## [1.337.0] - 2026-01-02
488
+
489
+ Initial release under @oh-my-pi scope. See previous releases at [badlogic/pi-mono](https://github.com/badlogic/pi-mono).
490
+
491
+ ## [0.31.1] - 2026-01-02
492
+
493
+ ### Fixed
494
+
495
+ - `visibleWidth()` now strips OSC 8 hyperlink sequences, fixing text wrapping for clickable links ([#396](https://github.com/badlogic/pi-mono/pull/396) by [@Cursivez](https://github.com/Cursivez))
496
+
497
+ ## [0.31.0] - 2026-01-02
498
+
499
+ ### Added
500
+
501
+ - `isShiftCtrlO()` key detection function for Shift+Ctrl+O (Kitty protocol)
502
+ - `isShiftCtrlD()` key detection function for Shift+Ctrl+D (Kitty protocol)
503
+ - `TUI.onDebug` callback for global debug key handling (Shift+Ctrl+D)
504
+ - `wrapTextWithAnsi()` utility now exported (wraps text to width, preserving ANSI codes)
505
+
506
+ ### Changed
507
+
508
+ - README.md completely rewritten with accurate component documentation, theme interfaces, and examples
509
+ - `visibleWidth()` reimplemented with grapheme-based width calculation, 10x faster on Bun and ~15% faster on Node ([#369](https://github.com/badlogic/pi-mono/pull/369) by [@nathyong](https://github.com/nathyong))
510
+
511
+ ### Fixed
512
+
513
+ - Markdown component now renders HTML tags as plain text instead of silently dropping them ([#359](https://github.com/badlogic/pi-mono/issues/359))
514
+ - Crash in `visibleWidth()` and grapheme iteration when encountering undefined code points ([#372](https://github.com/badlogic/pi-mono/pull/372) by [@HACKE-RC](https://github.com/HACKE-RC))
515
+ - ZWJ emoji sequences (rainbow flag, family, etc.) now render with correct width instead of being split into multiple characters ([#369](https://github.com/badlogic/pi-mono/pull/369) by [@nathyong](https://github.com/nathyong))
516
+
517
+ ## [0.29.0] - 2025-12-25
518
+
519
+ ### Added
520
+
521
+ - **Auto-space before pasted file paths**: When pasting a file path (starting with `/`, `~`, or `.`) and the cursor is after a word character, a space is automatically prepended for better readability. Useful when dragging screenshots from macOS. ([#307](https://github.com/badlogic/pi-mono/pull/307) by [@mitsuhiko](https://github.com/mitsuhiko))
522
+ - **Word navigation for Input component**: Added Ctrl+Left/Right and Alt+Left/Right support for word-by-word cursor movement. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
523
+ - **Full Unicode input**: Input component now accepts Unicode characters beyond ASCII. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
524
+
525
+ ### Fixed
526
+
527
+ - **Readline-style Ctrl+W**: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. ([#306](https://github.com/badlogic/pi-mono/pull/306) by [@kim0](https://github.com/kim0))
package/package.json CHANGED
@@ -1,32 +1,22 @@
1
1
  {
2
+ "type": "module",
2
3
  "name": "@oh-my-pi/pi-tui",
3
- "version": "12.17.0",
4
+ "version": "12.18.0",
4
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./src/index.ts",
11
- "import": "./src/index.ts"
12
- },
13
- "./components/*": {
14
- "types": "./src/components/*.ts",
15
- "import": "./src/components/*.ts"
16
- },
17
- "./*": {
18
- "types": "./src/*.ts",
19
- "import": "./src/*.ts"
20
- }
6
+ "homepage": "https://github.com/can1357/oh-my-pi",
7
+ "author": "Can Bölük",
8
+ "contributors": [
9
+ "Mario Zechner"
10
+ ],
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/can1357/oh-my-pi.git",
15
+ "directory": "packages/tui"
21
16
  },
22
- "scripts": {
23
- "check": "tsgo -p tsconfig.json",
24
- "test": "bun test test/*.test.ts"
17
+ "bugs": {
18
+ "url": "https://github.com/can1357/oh-my-pi/issues"
25
19
  },
26
- "files": [
27
- "src/**/*",
28
- "README.md"
29
- ],
30
20
  "keywords": [
31
21
  "tui",
32
22
  "terminal",
@@ -36,31 +26,44 @@
36
26
  "typescript",
37
27
  "cli"
38
28
  ],
39
- "author": "Can Bölük",
40
- "contributors": ["Mario Zechner"],
41
- "license": "MIT",
42
- "repository": {
43
- "type": "git",
44
- "url": "git+https://github.com/can1357/oh-my-pi.git",
45
- "directory": "packages/tui"
29
+ "main": "./src/index.ts",
30
+ "types": "./src/index.ts",
31
+ "scripts": {
32
+ "check": "tsgo -p tsconfig.json",
33
+ "test": "bun test test/*.test.ts"
46
34
  },
47
- "homepage": "https://github.com/can1357/oh-my-pi",
48
- "bugs": {
49
- "url": "https://github.com/can1357/oh-my-pi/issues"
50
- },
51
- "engines": {
52
- "bun": ">=1.3.7"
53
- },
54
- "dependencies": {
55
- "@oh-my-pi/pi-natives": "12.17.0",
56
- "@oh-my-pi/pi-utils": "12.17.0",
57
- "@types/mime-types": "^3.0.1",
58
- "chalk": "^5.6.2",
59
- "marked": "^17.0.2",
60
- "mime-types": "^3.0.2"
61
- },
62
- "devDependencies": {
63
- "@xterm/headless": "^6.0.0",
64
- "@xterm/xterm": "^6.0.0"
65
- }
35
+ "dependencies": {
36
+ "@oh-my-pi/pi-natives": "12.18.0",
37
+ "@oh-my-pi/pi-utils": "12.18.0",
38
+ "@types/mime-types": "^3.0.1",
39
+ "chalk": "^5.6.2",
40
+ "marked": "^17.0.2",
41
+ "mime-types": "^3.0.2"
42
+ },
43
+ "devDependencies": {
44
+ "@xterm/headless": "^6.0.0",
45
+ "@xterm/xterm": "^6.0.0"
46
+ },
47
+ "engines": {
48
+ "bun": ">=1.3.7"
49
+ },
50
+ "files": [
51
+ "src",
52
+ "README.md",
53
+ "CHANGELOG.md"
54
+ ],
55
+ "exports": {
56
+ ".": {
57
+ "types": "./src/index.ts",
58
+ "import": "./src/index.ts"
59
+ },
60
+ "./*": {
61
+ "types": "./src/*.ts",
62
+ "import": "./src/*.ts"
63
+ },
64
+ "./components/*": {
65
+ "types": "./src/components/*.ts",
66
+ "import": "./src/components/*.ts"
67
+ }
68
+ }
66
69
  }
package/src/tui.ts CHANGED
@@ -1005,8 +1005,10 @@ export class TUI extends Container {
1005
1005
  // Use previousLines.length (not maxLinesRendered) to avoid false positives after content shrinks
1006
1006
  const previousContentViewportTop = Math.max(0, this.#previousLines.length - height);
1007
1007
  if (firstChanged < previousContentViewportTop) {
1008
- // First change is above previous viewport - need full re-render
1008
+ // First change is above previous viewport - need hard full re-render
1009
+ // Force scrollback clear here because terminal state is likely desynced.
1009
1010
  logRedraw(`firstChanged < viewportTop (${firstChanged} < ${previousContentViewportTop})`);
1011
+ this.#clearScrollbackOnNextFullRender = true;
1010
1012
  fullRender(true);
1011
1013
  return;
1012
1014
  }