commit 310d01d8faa58da570a7f50c8e0bf2a9940a5139
parent 832ce0ac4b0f2a26c60a46db256e2f91359402ea
Author: Elias Assaf <elyas51000@gmail.com>
Date: Tue, 2 Dec 2025 04:52:40 +0200
fix(clipboard): tmux clipboard data may be stale #36787
Problem:
When Nvim wants to paste from tmux, it doesn't tell tmux to read the OS
clipboard first, so it may have stale clipboard state.
Solution:
Tickle `tmux refresh-client -l`, before requesting paste, as recommended
in the tmux manpage. https://man7.org/linux/man-pages/man1/tmux.1.html
Fixes https://github.com/neovim/neovim/issues/36786
Signed-off-by: Elias Assaf <elyas51000@gmail.com>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
@@ -168,7 +168,7 @@ function! s:set_tmux() abort
else
let s:copy['+'] = ['tmux', 'load-buffer', '-']
endif
- let s:paste['+'] = ['tmux', 'save-buffer', '-']
+ let s:paste['+'] = ['sh', '-c', 'tmux refresh-client -l && sleep 0.05 && tmux save-buffer -']
let s:copy['*'] = s:copy['+']
let s:paste['*'] = s:paste['+']
return 'tmux'