From e8269a3ab5f4505f27997b46b0eaf9464d186cf9 Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 15 Apr 2020 21:54:23 +0900 Subject: win,runtime: Fix problem when win32yank was a symbolic link in WSL [skip ci] (#12124) On some versions of Windows, WSL is unable to execute symbolic links to Windows executables (microsoft/WSL#3999). As a workaround for that problem this changes to use resolve() on WSL if win32yank was a symbolic link. fixes #12113. --- runtime/autoload/provider/clipboard.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index c86f7d0c2f..a96a0a61b7 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -113,8 +113,13 @@ function! provider#clipboard#Executable() abort let s:paste['*'] = s:paste['+'] return 'doitclient' elseif executable('win32yank.exe') - let s:copy['+'] = 'win32yank.exe -i --crlf' - let s:paste['+'] = 'win32yank.exe -o --lf' + if has('wsl') && getftype(exepath('win32yank.exe')) == 'link' + let win32yank = resolve(exepath('win32yank.exe')) + else + let win32yank = 'win32yank.exe' + endif + let s:copy['+'] = win32yank.' -i --crlf' + let s:paste['+'] = win32yank.' -o --lf' let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] return 'win32yank' -- cgit