diff --git a/config/tmux-ccb.conf b/config/tmux-ccb.conf index dfaff19..0d2df18 100644 --- a/config/tmux-ccb.conf +++ b/config/tmux-ccb.conf @@ -83,10 +83,11 @@ if-shell 'command -v pbcopy' { bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy' bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'pbcopy' } -if-shell 'command -v clip.exe' { - bind-key -T copy-mode-vi 'y' send -X copy-pipe 'clip.exe' - bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'clip.exe' - bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'clip.exe' +# WSL: Use PowerShell for clipboard (clip.exe doesn't support UTF-8) +if-shell '[ -n "$WSL_DISTRO_NAME" ] && command -v powershell.exe' { + bind-key -T copy-mode-vi 'y' send -X copy-pipe "powershell.exe -NoProfile -Command 'Set-Clipboard -Value ([Console]::In.ReadToEnd())'" + bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "powershell.exe -NoProfile -Command 'Set-Clipboard -Value ([Console]::In.ReadToEnd())'" + bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "powershell.exe -NoProfile -Command 'Set-Clipboard -Value ([Console]::In.ReadToEnd())'" } # Paste from system clipboard (try providers in order; avoids X11/Wayland mis-detection).