From c40c2973a7a9f0c5d62a82ba7f128310731c1306 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Tue, 12 May 2026 14:39:50 +0100 Subject: [PATCH] Fix copying in a session nested in display-popup --- tmux.conf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tmux.conf b/tmux.conf index bc83610..a5c376a 100644 --- a/tmux.conf +++ b/tmux.conf @@ -32,6 +32,9 @@ if '~/.config/tmux/check-version.sh "<" 3.2' \ 'set-option -as terminal-features ",xterm*:Tc"' \ 'set-option -as terminal-features ",xterm*:RGB"' +# Declare clipboard (OSC-52) support so tmux emits it for copy-pipe. +set -as terminal-features ',xterm*:clipboard' + # Focus events enabled for terminals that support them set -g focus-events on @@ -157,8 +160,10 @@ if -b '[ "$SSH_TTY" != "" ]' \ if -b '[ "`uname`" = "Darwin" ]' \ 'bind -T copy-mode-vi y send-keys -X copy-pipe "pbcopy"' # When not in WSL2 use xsel, when in WSL use win32yank.exe to avoid UI lockups. -if -b '[ "$WSLENV" = "" ]' \ - 'bind -T copy-mode-vi y send-keys -X copy-pipe "xsel -i --clipboard"' \ - 'bind -T copy-mode-vi y send-keys -X copy-pipe "win32yank.exe -i -crlf"' +if -b '[ "`uname`" != "Darwin" ]' { + if -b '[ "$WSLENV" = "" ]' \ + 'bind -T copy-mode-vi y send-keys -X copy-pipe "xsel -i --clipboard"' \ + 'bind -T copy-mode-vi y send-keys -X copy-pipe "win32yank.exe -i -crlf"' +} source-file ~/.config/tmux/theme.tmux