From 396de0003c2d7dd3d9c0e327f5a43b5a73dec760 Mon Sep 17 00:00:00 2001 From: Andrejus Date: Fri, 13 Mar 2026 17:17:24 +0000 Subject: [PATCH] feat(tmux): simplify copy-mode to OSC52, remove condensed toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop pbcopy/xclip/xsel pipe hacks — OSC52 via set-clipboard handles system clipboard automatically. Remove @condensed status bar toggle, simplify status click to lock-session. Add client-focus-in mouse reset workaround. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- home/.tmux.conf | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/home/.tmux.conf b/home/.tmux.conf index e1a2c9b..2b76186 100644 --- a/home/.tmux.conf +++ b/home/.tmux.conf @@ -24,18 +24,15 @@ set -g display-time 4000 # Mouse set -g mouse on set -g set-clipboard on -set -g @condensed 0 -bind -T root MouseDown1StatusRight if-shell \ - "[ $(( #{mouse_x} )) -ge $(( #{client_width} - 9 )) ]" \ - "lock-session" \ - 'if-shell "[ \"$(tmux show-option -gqv @condensed)\" = 1 ]" "set -g @condensed 0" "set -g @condensed 1"' +set-hook -g client-focus-in 'set -g mouse off ; set -g mouse on' +bind -T root MouseDown1StatusRight lock-session -# Copy mode +# Copy mode — OSC52 via set-clipboard handles system clipboard automatically setw -g mode-keys vi bind -T copy-mode-vi v send -X begin-selection -bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard" +bind -T copy-mode-vi y send -X copy-selection-and-cancel bind -T copy-mode-vi MouseDown1Pane send -X clear-selection -bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "pbcopy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard" +bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel # Splits bind | split-window -h -c "#{pane_current_path}"