cc90ed37f8
- Extracted manual space padding logic into a reusable `padding()` utility function across all UI components and utilities. - Optimized padding operations by introducing a pre-allocated 512-space buffer in the `padding()` function to reduce repeated string allocations. - Updated all imports across 30 files to use the new `padding()` function from pi-tui instead of inline `' '.repeat()` calls. - Renamed local variables from `padding` to `pad`, `padSize`, `indent`, or `linePad` to avoid naming conflicts with the imported `padding()` function. - Exported the `padding()` utility function from the tui package index for public use.
13 KiB
13 KiB
Changelog
[Unreleased]
Added
- Exported
paddingutility function for creating space-padded strings efficiently
Changed
- Optimized padding operations across all components to use pre-allocated space buffer for better performance
[9.2.2] - 2026-01-31
Added
- Added setAutocompleteMaxVisible() configuration (3-20 items)
- Added image detection to terminal capabilities (containsImage method)
- Added stdin monitoring to detect stalled input events and log warnings
Changed
- Improved blockquote rendering with text wrapping in Markdown component
- Restructured terminal capabilities from interface-based to class-based model
- Improved table column width calculation with word-aware wrapping
- Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path
Fixed
- Simplified terminal write error handling to mark terminal as dead on any write failure
- Fixed multi-line strings in renderOutputBlock causing width overflow
- Fixed slash command autocomplete applying stale completion when typing quickly
Removed
- Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)
[8.12.7] - 2026-01-29
Fixed
- Fixed slash command autocomplete applying stale completion when typing quickly
[8.4.1] - 2026-01-25
Added
- Added fuzzy match function for autocomplete suggestions
[8.4.0] - 2026-01-25
Changed
- Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching
Fixed
- Terminal gracefully handles write failures by marking dead instead of exiting the process
- Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
- Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()
[8.2.0] - 2026-01-24
Added
- Added mermaid diagram rendering engine (renderMermaidToPng) with mmdc CLI integration
- Added terminal graphics encoding (iTerm2/Kitty) for mermaid diagrams with automatic width scaling
- Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)
Changed
- Updated TypeScript configuration for better publish-time configuration handling with tsconfig.publish.json
- Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
- Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines
Fixed
- Fixed crash when terminal becomes unavailable (EIO errors) by exiting gracefully instead of throwing
- Fixed potential errors during emergency terminal restore when terminal is already dead
- Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results
[6.8.3] - 2026-01-21
Added
- Added undo support in the editor via
Ctrl+- - Added
Alt+Deleteas a delete-word-forward shortcut - Added configurable code block indentation for Markdown rendering
- Added undo support in the editor via
Ctrl+-. - Added configurable code block indentation for Markdown rendering.
- Added
Alt+Deleteas a delete-word-forward shortcut.
Changed
- Improved fuzzy matching to handle alphanumeric swaps
- Normalized keybinding definitions to lowercase internally
- Improved fuzzy matching to handle alphanumeric swaps.
- Normalized keybinding definitions to lowercase internally.
Fixed
- Added legacy terminal support for
Ctrl+symbol key combinations - Added legacy terminal support for
Ctrl+symbol key combinations.
[6.8.1] - 2026-01-20
Fixed
- Fixed viewport tracking after partial renders to prevent autocomplete list artifacts
[5.6.7] - 2026-01-18
Added
- Added configurable editor padding via
editorPaddingXtheme option - Added
setMaxHeight()method to limit editor height with scrolling - Added Emacs-style kill ring for text deletion operations
- Added
Alt+Dkeybinding to delete words forward - Added
Ctrl+Ykeybinding to yank from kill ring - Added
waitForRender()method to await pending renders - Added Focusable interface and hardware cursor marker support for IME positioning
- Added support for shifted symbol keys in keybindings
Changed
- Updated tab bar rendering to wrap text across multiple lines when content exceeds available width
- Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
- Improved cursor positioning with safer bounds checking
- Updated editor layout to respect configurable padding
- Refactored scrolling logic for better viewport management
Fixed
- Fixed key detection for shifted symbol characters
- Fixed backspace handling with additional codepoint support
- Fixed Alt+letter key combinations for better recognition
[5.3.1] - 2026-01-15
Fixed
- Fixed rendering issues on Windows by preventing re-entrant renders
[5.1.0] - 2026-01-14
Added
- Added
pageUpandpageDownkey support withselectPageUp/selectPageDowneditor actions - Added
isPageUp()andisPageDown()helper functions - Added
SizeValuetype for CSS-like overlay sizing (absolute or percentage strings like"50%") - Added
OverlayHandleinterface withhide(),setHidden(),isHidden()methods for overlay visibility control - Added
visiblecallback toOverlayOptionsfor dynamic visibility based on terminal dimensions - Added
padparameter totruncateToWidth()for padding result with spaces to exact width
Changed
- Changed
OverlayOptionsto useSizeValuetype forwidth,maxHeight,row, andcolproperties - Changed
showOverlay()to returnOverlayHandlefor controlling overlay visibility - Removed
widthPercent,maxHeightPercent,rowPercent,colPercentfromOverlayOptions(use percentage strings instead)
Fixed
- Fixed numbered list items showing "1." for all items when code blocks break list continuity
- Fixed width overflow protection in overlay compositing to prevent TUI crashes
[4.7.0] - 2026-01-12
Fixed
- Remove trailing space padding from Text, Markdown, and TruncatedText components when no background color is set (fixes copied text including unwanted whitespace)
[4.6.0] - 2026-01-12
Added
- Add fuzzy matching module (
fuzzyMatch,fuzzyFilter) for command autocomplete - Add
getExpandedText()to editor for expanding paste markers - Add backslash+enter newline fallback for terminals without Kitty protocol
Fixed
- Remove Kitty protocol query timeout that caused shift+enter delays
- Add bracketed paste check to prevent false key release/repeat detection
- Rendering optimizations: only re-render changed lines
- Refactor input component to use keybindings manager
[4.4.4] - 2026-01-11
Fixed
- Fixed Ctrl+Enter sequences to insert new lines in the editor
[4.2.1] - 2026-01-11
Changed
- Improved file autocomplete to show directory listing when typing
@with no query, and fall back to prefix matching when fuzzy search returns no results
Fixed
- Fixed editor redraw glitch when canceling autocomplete suggestions
- Fixed
fdtool detection to automatically findfdorfdfindin PATH when not explicitly configured
[4.1.0] - 2026-01-10
Added
- Added persistent prompt history storage support via
setHistoryStorage()method, allowing history to be saved and restored across sessions
[4.0.0] - 2026-01-10
Added
EditorComponentinterface for custom editor implementationsStdinBufferclass to split batched stdin into individual sequences- Overlay compositing via
TUI.showOverlay()andTUI.hideOverlay()forctx.ui.custom()with{ overlay: true } - Kitty keyboard protocol flag 2 support for key release events (
isKeyRelease(),isKeyRepeat(),KeyEventType) setKittyProtocolActive(),isKittyProtocolActive()for Kitty protocol state managementkittyProtocolActiveproperty on Terminal interface to query Kitty protocol stateComponent.wantsKeyReleaseproperty to opt-in to key release events (default false)- Input component
onEscapecallback for handling escape key presses
Changed
- Terminal startup now queries Kitty protocol support before enabling event reporting
- Default editor
newLinebinding now usesshift+enteronly
Fixed
- Key presses no longer dropped when batched with other events over SSH
- TUI now filters out key release events by default, preventing double-processing of keys
matchesKey()now correctly matches Kitty protocol sequences for unmodified letter keys- Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering
[3.32.0] - 2026-01-08
Fixed
- Fixed text wrapping allowing long whitespace tokens to exceed line width
[3.20.0] - 2026-01-06
Added
- Added
isCapsLockhelper function for detecting Caps Lock key press via Kitty protocol - Added
isCtrlYhelper function for detecting Ctrl+Y keyboard input - Added configurable editor keybindings with typed key identifiers and action matching
- Added word-wrapped editor rendering for long lines
Changed
- Settings list descriptions now wrap to the available width instead of truncating
Fixed
- Fixed Shift+Enter detection in legacy terminals that send ESC+CR sequence
[3.15.1] - 2026-01-05
Fixed
- Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.
[3.15.0] - 2026-01-05
Added
- Added
inputCursorsymbol for customizing the text input cursor character - Added
symbolsproperty toEditorTheme,MarkdownTheme, andSelectListThemeinterfaces for component-level symbol customization - Added
SymbolThemeinterface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters - Added support for custom spinner frames in the Loader component
[3.9.1337] - 2026-01-04
Added
- Added
setTopBorder()method to Editor component for displaying custom status content in the top border - Added
getWidth()method to TUI class for retrieving terminal width - Added rounded corner box-drawing characters to Editor component borders
Changed
- Changed Editor component to use proper box borders with vertical side borders instead of horizontal-only borders
- Changed cursor style from block to thin blinking bar (▏) at end of line
[1.500.0] - 2026-01-03
Added
- Added
getText()method to Text component for retrieving current text content
[1.337.1] - 2026-01-02
Added
- TabBar component for horizontal tab navigation
- Emergency terminal restore to prevent corrupted state on crashes
- Overhauled UI with welcome screen and powerline footer
- Theme-configurable HTML export colors
ctx.ui.themegetter for styling status text with theme colors
Changed
- Forked to @oh-my-pi scope with unified versioning across all packages
Fixed
- Strip OSC 8 hyperlink sequences in
visibleWidth() - Crash on Unicode format characters in
visibleWidth() - Markdown code block syntax highlighting
[1.337.0] - 2026-01-02
Initial release under @oh-my-pi scope. See previous releases at badlogic/pi-mono.
[0.31.1] - 2026-01-02
Fixed
visibleWidth()now strips OSC 8 hyperlink sequences, fixing text wrapping for clickable links (#396 by @Cursivez)
[0.31.0] - 2026-01-02
Added
isShiftCtrlO()key detection function for Shift+Ctrl+O (Kitty protocol)isShiftCtrlD()key detection function for Shift+Ctrl+D (Kitty protocol)TUI.onDebugcallback for global debug key handling (Shift+Ctrl+D)wrapTextWithAnsi()utility now exported (wraps text to width, preserving ANSI codes)
Changed
- README.md completely rewritten with accurate component documentation, theme interfaces, and examples
visibleWidth()reimplemented with grapheme-based width calculation, 10x faster on Bun and ~15% faster on Node (#369 by @nathyong)
Fixed
- Markdown component now renders HTML tags as plain text instead of silently dropping them (#359)
- Crash in
visibleWidth()and grapheme iteration when encountering undefined code points (#372 by @HACKE-RC) - ZWJ emoji sequences (rainbow flag, family, etc.) now render with correct width instead of being split into multiple characters (#369 by @nathyong)
[0.29.0] - 2025-12-25
Added
- 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 by @mitsuhiko) - Word navigation for Input component: Added Ctrl+Left/Right and Alt+Left/Right support for word-by-word cursor movement. (#306 by @kim0)
- Full Unicode input: Input component now accepts Unicode characters beyond ASCII. (#306 by @kim0)