From 99efe19e30dbcc4c162ff47411d7add94e55424f Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 18 May 2026 17:07:51 -0400 Subject: fix(tmux): pipe M-w copies to the system clipboard via wl-copy `copy-selection' writes only to tmux's internal paste buffer, so a paste in any other app got stale content. Switch the M-w binding to `copy-pipe-no-clear "wl-copy"' (same engine as the existing y binding, minus the -and-cancel so M-w stays in copy-mode for repeated grabs). The selection stays visible after copy to make multi-range copying easier to follow. --- dotfiles/common/.tmux.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/common/.tmux.conf b/dotfiles/common/.tmux.conf index 071be99..6c18a05 100644 --- a/dotfiles/common/.tmux.conf +++ b/dotfiles/common/.tmux.conf @@ -81,10 +81,13 @@ unbind-key C-z set -g status-keys emacs # copy-mode keys mirror the Emacs cj/vterm-tmux-history story -# (~/.emacs.d/modules/vterm-config.el): M-w copies and stays in mode -# for repeated copying; q / Escape / C-g exit without copying; -# Enter is unbound so RET has no "copy and exit" shortcut. -bind-key -T copy-mode M-w send-keys -X copy-selection +# (~/.emacs.d/modules/vterm-config.el): M-w copies to the system +# clipboard via wl-copy and stays in mode for repeated copying; +# q / Escape / C-g exit without copying; Enter is unbound so RET +# has no "copy and exit" shortcut. `copy-selection' alone writes +# only to tmux's internal paste buffer; the pipe-no-clear variant +# reaches the OS clipboard and keeps the selection visible. +bind-key -T copy-mode M-w send-keys -X copy-pipe-no-clear "wl-copy" bind-key -T copy-mode C-g send-keys -X cancel unbind-key -T copy-mode Enter -- cgit v1.2.3