szn v0.4.0
9 commits since v0.3.1.
Headline: Multi-Client Display, Mouse Drag Selection, and OSC 52 Clipboard
This minor release introduces simultaneous multi-client support, mouse-driven copy selection, and clipboard protocol forwarding:
- Simultaneous Multi-Client Display — Multiple clients can now attach to the same session concurrently. The server broadcasts output to all connected display clients and enforces resize constraints to the smallest attached terminal dimensions.
- Mouse Click and Drag Selection — Clicking and dragging with the left mouse button now creates a visual selection in copy-mode. Releasing the mouse button yanks the selected text to the paste buffer, matching tmux’s mouse-select-pane behavior.
- Mouse Drag/Motion Event Forwarding — Applications inside panes that enable mouse tracking (1002/1003 modes) now receive drag and motion events forwarded correctly via SGR or legacy encoding.
- OSC 52 Clipboard Protocol — Supports OSC 52 clipboard set sequences from pane applications, decoding base64 content into the paste buffer and forwarding the sequence to attached display clients for system clipboard integration.
- Performance Optimizations — Grid reflow, scrollback history eviction, event loop pollfds, and TTY rendering now use double buffering for significantly improved throughput during rapid output.
New Features
- Multi-client display support — Multiple terminals can attach to the same szn session simultaneously.
- Mouse drag selection — Left-click and drag to select text, release to copy to paste buffer.
- Mouse drag forwarding — Drag events (button code 32+) are now parsed and forwarded to pane PTYs.
- OSC 52 clipboard set — Applications can write to the system clipboard via
\x1b]52;c;<base64>\x07.
| Component |
Optimization |
| Grid reflow |
Reduced allocations during resize operations |
| Scrollback history |
Eviction logic optimized for high-throughput scenarios |
| Event loop |
pollfds array reuse to avoid per-iteration allocation |
| TTY rendering |
Double buffering to minimize terminal write syscalls |
Bug Fixes
| Description |
Severity |
| OSC 52 raw sequence leaked into display client protocol stream |
High |
| Mouse drag event forwarding test used wrong PTY file descriptor |
Low |
| Test hardcoded macOS O_NONBLOCK value (0x0004) instead of platform-specific |
Low |