-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlugClean crash with PowerShell #1129
Comments
I came across the same problem. after i had been debugging plug.vim for at least 3 hours. finally, i found where the bug is. your powershell's version should be lower than 7.0, and it cant't recognize the "&&" in external command "cd /d ^"path^" && & commands" which follow the argument "-command"(the similar problem is "cd /c", even higher than 7.0,powershell doesn't recognize the "/c") , the bug is in "plug.vim ->s:clean() -> s:git_validate() -> s:system() ". |
I have shell pwsh " ~/_vimrc
if has('win32')
set shell=pwsh
let &shellcmdflag='-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command'
if !has('patch-8.2.3079')
let &shellcmdflag = ' ' . &shellcmdflag
endif
let &shellxquote='"'
set shellxescape= shellquote= noshellslash
let &shellredir = '2>&1 | Out-File -Encoding Default %s; exit $LastExitCode'
endif I had to modify
" function! s:with_cd(cmd, dir, ...)
...
return printf('cd%s %s && %s', s:is_powershell(&shell) ? '' : s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd)
...
" function! plug#shellescape(arg, ...)
...
let shell = 'pwsh'" get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh')
...
" function! s:spawn(name, cmd, opts)
...
let argv = s:is_powershell(&shell)
\ ? ['pwsh', '-NoLogo', '-NoProfile', '-ExecutionPolicy', 'RemoteSigned', '-Command', '"'.cmd.'"']
\ : s:is_win
\ ? ['cmd', '/s', '/c', '"'.cmd.'"']
\ : ['sh', '-c', cmd]
... |
Explain the problem here ...
Here is my minimal _vimrc with shell is PowerShell
When I use :PlugClean it crash and return
but delete
set shell=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
it's ok.Vim version:
The text was updated successfully, but these errors were encountered: