Skip to content

v0.1.6 - amd64(x64)

Choose a tag to compare

@pirogom pirogom released this 16 Aug 13:33
· 21 commits to main since this release

Release v0.1.6

πŸš€ Highlights & Overview

v0.1.6 brings major stability, concurrency, and performance improvements to the terminal backend and WebSocket
communication pipeline. This release addresses real-world edge cases when working with modern interactive AI CLI agents
(such as Opencode, Claude Code, Aider, and Gemini CLI) and complex TUI applications (Vim, Lazygit, Htop), including rapid
typing, dynamic prompt expansions, heavy scrolling through multi-line conversation histories, power management resume, and
multi-session switching.
──────

πŸ› οΈ Key Improvements & Fixes

1. Asynchronous Terminal Input Pipeline & WebSocket Resilience

β€’ Non-blocking Input Queue (Pane.WriteInput): Decoupled the WebSocket receiver loop from OS PTY pipe writes using an
asynchronous channel queue (inCh, 1024 capacity) and a dedicated worker loop.
β€’ Ping/Pong Heartbeat Protection: Prevents child process stdin backpressure or TUI layout recalculation locks from stalling
the WebSocket read loop and dropping connections.
β€’ Frontend Input Micro-batching: Implemented an imperceptible ~4ms micro-batching buffer in xterm.js to bundle rapid
keystroke bursts and long pastes, drastically reducing WebSocket framing overhead.

2. ConPTY Win32 Concurrency Serialization & Session Switching Reflows

β€’ Thread-safe Win32 ConPTY Operations: Added resizeMu sync.Mutex inside the Windows ConPTY host to strictly serialize
Resize and ForceRedraw calls, eliminating race conditions and pipe crashes when rapidly switching between active sessions.
β€’ Debounced ForceRedraw: Applied a 35ms debouncing timer to consolidate rapid redraw requests into a single safe screen
refresh.
β€’ Streamlined Frontend Reflow: Replaced multi-staged setTimeout reflow cascades with a single requestAnimationFrame pass,
eliminating redundant redraw message bursts.

3. Active VT Mode Synchronization across Multi-Clients & Display Wake

β€’ VTModeTracker Engine: Implemented real-time tracking of active DECSET/DECRST terminal modes (?1049h Alternate Screen
Buffer, ?1000h/?1002h/?1006h SGR Mouse Tracking, ?2004h Bracketed Paste).
β€’ Mode Preamble Injection: When a new window or browser client attaches to an already-running TUI session, active mode
preambles are automatically injected before history replay, ensuring immediate mouse wheel scrolling and click support.
β€’ Display Wake & Reconnect Preservation: Removed disruptive term.reset() calls on connection restore and added WebGL
context loss handling (onContextLoss) to keep TUI mouse tracking intact after display sleep/wake cycles.

4. Binary WebSocket Terminal Stream & Scroll Resilience

β€’ Binary Stream Conversion (websocket.MessageBinary): Switched /ws/pane/{id} terminal streams from text to binary WebSocket
frames.
β€’ UTF-8 Buffer Split Protection: Prevents WebSocket protocol errors (1007: Invalid UTF-8) caused by multi-byte characters
(Korean, Box-drawing borders, emojis, and ANSI styling) split across 64KB read boundaries during high-throughput TUI
scrolling.
β€’ Expanded Writer Pump Capacity: Increased channel buffer to 1024 chunks and frame coalescing limit to 128KB, delivering
silky-smooth scrolling through thousands of lines of past TUI history without backpressure.