Skip to content

feat: Implement mouse drag selection with auto-copy to clipboard in TUI and add macOS tmux clipboard integration.#4

Merged
ChesterRa merged 1 commit intoChesterRa:mainfrom
dweb-channel:main
Dec 6, 2025
Merged

feat: Implement mouse drag selection with auto-copy to clipboard in TUI and add macOS tmux clipboard integration.#4
ChesterRa merged 1 commit intoChesterRa:mainfrom
dweb-channel:main

Conversation

@waterbang
Copy link
Copy Markdown
Collaborator

@waterbang waterbang commented Dec 3, 2025

Hi, This is a very radical update and you can reject it

…UI and add macOS tmux clipboard integration.
@ChesterRa ChesterRa merged commit ea500a5 into ChesterRa:main Dec 6, 2025
ChesterRa pushed a commit that referenced this pull request Dec 6, 2025
…selection

Problem:
- Original PR (#4) only supported macOS (hardcoded pbcopy)
- WSL2/Linux users couldn't copy selected text
- No fallback logic for different clipboard tools

Solution:
1. Created set_clipboard_text() utility function with platform detection:
   - macOS: pbcopy
   - WSL2: clip.exe (auto-detected via _is_wsl())
   - Linux Wayland: wl-copy
   - Linux X11: xclip or xsel
   - Windows: PowerShell Set-Clipboard

2. Updated tmux clipboard bindings to dynamically detect tool:
   - Removed hardcoded 'pbcopy'
   - Added shutil.which() detection for all clipboard tools
   - Only configures bindings if a tool is available

3. Improved TUI feedback message:
   - Changed from 'Cmd+V' (macOS-specific) to generic 'clipboard'
   - Fixed plural handling ('1 line' vs 'N lines')

Tested on:
- WSL2: clip.exe ✓
- Will work on macOS (pbcopy), native Linux (xclip/wl-copy), Windows (clip.exe)

Fixes: Mouse selection now works across all platforms with appropriate clipboard tools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants