mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 09:02:40 +00:00
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>
(cherry picked from commit 310d01d8fa)
This commit is contained in:
committed by
github-actions[bot]
parent
fa24e045e9
commit
43f5297fe3
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user