fix tmux copy on nixos hosts

This commit is contained in:
Yan Lin 2025-10-20 16:19:17 +02:00
parent 65c42fa1a0
commit e05f5ef788
2 changed files with 12 additions and 3 deletions

View file

@ -62,6 +62,10 @@
fastfetch
coreutils # GNU core utilities (base64, etc.)
# Clipboard utilities for tmux integration
wl-clipboard # Wayland clipboard (wl-copy/wl-paste)
xclip # X11 clipboard fallback
# Development and build tools
python312
uv

View file

@ -75,7 +75,12 @@
# Better copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy"
# Platform-aware clipboard: pbcopy (macOS) | wl-copy (Wayland) | xclip (X11)
bind-key -T copy-mode-vi y if-shell 'command -v pbcopy' \
'send-keys -X copy-pipe-and-cancel "pbcopy"' \
'if-shell "test -n \"$WAYLAND_DISPLAY\"" \
"send-keys -X copy-pipe-and-cancel \"wl-copy\"" \
"send-keys -X copy-pipe-and-cancel \"xclip -selection clipboard\""'
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# New window with current path