Skip to content

v0.8.2

Choose a tag to compare

@cwt cwt released this 24 Aug 03:54
· 222 commits to main since this release

szn v0.8.2

62 commits since v0.8.1. 927 tests passing.


Headline: Stability, Memory Hardening, and Terminal Emulation Fidelity

v0.8.2 is a major stability and reliability release addressing 46 items filed during the deep code audit (#349–#394) and closing out all open actionable bug tracker entries. Key highlights include critical crash and memory safety fixes, elimination of several major memory leaks, accurate DECSTBM scroll region emulation across lines and auto-wraps, standard vi copy-mode defaults with immediate search bar feedback, and seamless keystroke forwarding.


Key Improvements

1. Crash & Memory Safety Fixes

  • Use-After-Free in Batch Polls (#362): Server.isPaneValid now validates candidate pane pointers against live sessions and window trees before dereferencing, preventing crashes on stale batch I/O events following session destruction.
  • Pane Lifecycle & Double-Free (#366): Layout.removePane strictly detaches layout nodes without destroying pane memory, ensuring Server.destroyPane remains the single authoritative pane lifecycle owner.
  • Merged Screen Pointer Guard (#367): Nullified merged_screen slot during resize failure paths to prevent double-free or dangling pointer access.
  • Benign Non-Blocking Reads (#373): Handled EAGAIN/EWOULDBLOCK on client sockets gracefully instead of treating them as client disconnects.
  • IPC Packet Bounds Checking (#375): Enforced strict upper bounds on wire-declared packet lengths to prevent memory allocation exhaustion and DoS attacks.
  • Urgent Command Delivery (#376): Routed server command responses via an urgent queue so throttled or behind clients receive prompt replies without hanging.
  • Listener Socket Probing (#378): Socket path is probed via connect() before unlinking stale sockets, and directory listener permissions are enforced to 0700.

2. Memory Leak & Churn Elimination

  • Zero-Allocation Clock Mode (#359): Implemented Grid.copyVisibleFrom for in-place grid copying during clock mode, eliminating the multi-megabyte/second memory growth from continuous grid and scrollback cloning.
  • Window Title & CWD Arena Leaks (#358, #385): Fixed inline name_buf window title management in auto-rename and eliminated write-only accumulators.
  • Paste Buffer & OSC52 Caps (#357, #363, #382): Enforced MAX_PASTE_SIZE and exact buffer allocations for OSC52 payloads and load-buffer commands.

3. Terminal Emulation & Parser Fidelity

  • Unified DECSTBM Scroll Regions (#368): Unified newline (\n), auto-margin wrapping, and index (ESC D) scrolling through advanceLine() so full-screen TUIs (vim, htop, less) with fixed margins do not corrupt header lines or history.
  • Universal Sequence Abort on CAN/SUB (#388): Implemented VT500/ECMA-48 cancellation for escape, CSI, OSC, and DCS sequences on CAN (0x18) and SUB (0x1A).
  • Text Reflow & History Trimming (#347, #371): Preserved cursor position across empty prompt lines during copy-mode entry reflow, and capped rebuilt reflow history to history_limit.
  • Sixel Overlay Tracking (#387): Maintained sixel image anchor offsets across scroll region operations and raised simultaneous overlay limit to 32.
  • Palette and Modifiers Hardening (#354, #355, #356): Hardened SGR indexed colour bounds, modifyOtherKeys parsing, and sixel raster dimension parsing against overflow panics.

4. Input & User Experience

  • Root Keybinding Dispatch (#353): Directly connected root table keybindings (bind-key -n) to the input dispatcher without requiring prefix key interception.
  • Copy-Mode Defaults & Search Bar (#384): Restored mode-keys default to "vi", allowing standard vi motion keys (h/j/k/l, v, y, w/b, 0/$, g/G) out of the box. Unified / and ? search activation across keymaps with immediate status bar repainting.
  • Fast-Forward Keystrokes: Optimized client startup to immediately forward non-reply keystrokes without delay during cell-size query waiting.
  • Copy-Mode Mouse Polish (#379): Bare mouse clicks no longer yank or exit copy-mode, and existing selections clear cleanly.
  • Escape-Time Timer (#350): Added inactivity timer so standalone ESC keys are flushed promptly as Escape instead of lingering into Alt+key.
  • CR vs LF Separation (#349): Distinctly decoded Enter as CR (\r) and Ctrl-J as LF (\n).

Testing & Quality Assurance

Metric v0.8.1 v0.8.2
Total Passing Tests 870 927
New Regression Tests — 57
Build Status Debug & ReleaseSafe Debug, ReleaseSafe & ReleaseFast passing