mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 02:34:59 -07:00
fix(clipboard): tmux clipboard depends on $TMUX #31268
Problem: tmux clipboard not used when tmux is a daemon and $TMUX is empty. Solution: If `tmux list-buffers` succeeds, use tmux clipboard.
This commit is contained in:
parent
0e299ebf75
commit
2495e7e22a
@ -158,7 +158,7 @@ function! provider#clipboard#Executable() abort
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
return 'termux-clipboard'
|
||||
elseif !empty($TMUX) && executable('tmux')
|
||||
elseif executable('tmux') && (!empty($TMUX) || 0 == jobwait([jobstart(['tmux', 'list-buffers'])], 2000)[0])
|
||||
let tmux_v = v:lua.vim.version.parse(system(['tmux', '-V']))
|
||||
if !empty(tmux_v) && !v:lua.vim.version.lt(tmux_v, [3,2,0])
|
||||
let s:copy['+'] = ['tmux', 'load-buffer', '-w', '-']
|
||||
|
Loading…
Reference in New Issue
Block a user