Repository navigation
v0.8.2
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.isPaneValidnow 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.removePanestrictly detaches layout nodes without destroying pane memory, ensuringServer.destroyPaneremains the single authoritative pane lifecycle owner. - Merged Screen Pointer Guard (#367): Nullified
merged_screenslot during resize failure paths to prevent double-free or dangling pointer access. - Benign Non-Blocking Reads (#373): Handled
EAGAIN/EWOULDBLOCKon 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 to0700.
2. Memory Leak & Churn Elimination
- Zero-Allocation Clock Mode (#359): Implemented
Grid.copyVisibleFromfor 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_bufwindow title management in auto-rename and eliminated write-only accumulators. - Paste Buffer & OSC52 Caps (#357, #363, #382): Enforced
MAX_PASTE_SIZEand exact buffer allocations for OSC52 payloads andload-buffercommands.
3. Terminal Emulation & Parser Fidelity
- Unified DECSTBM Scroll Regions (#368): Unified newline (
\n), auto-margin wrapping, andindex(ESC D) scrolling throughadvanceLine()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) andSUB(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-keysdefault 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
ESCkeys are flushed promptly as Escape instead of lingering intoAlt+key. - CR vs LF Separation (#349): Distinctly decoded Enter as
CR(\r) andCtrl-JasLF(\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 |