Commit graph

1 commit

Author SHA1 Message Date
3ec75f6264 Add clipboard support via OSC 52 escape sequences
New features:
- Copy text to system clipboard (Ctrl+V paste)
- Copy to X11 primary selection (middle-click paste)
- Copy to both selections simultaneously
- Clear clipboard contents
- Query clipboard (limited terminal support)
- Parse OSC 52 responses

API:
- copy(allocator, writer, text) - allocating version
- copySmall(writer, text) - stack-based for text <= 1024 bytes
- copyTo/copySmallTo - select target (clipboard/primary/both)
- clear(writer) - clear clipboard
- parseResponse(allocator, response) - decode clipboard responses

Example: clipboard_demo.zig with interactive testing

Tests: 8 clipboard tests, all pass

Terminal support: xterm, iTerm2, kitty, alacritty, WezTerm, foot
Note: tmux requires 'set -g set-clipboard on'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 13:43:36 +01:00