runtime(netrw): Fixing powershell execution issues on Windows

Commit: 
https://github.com/vim/vim/commit/d7745acbd8fe1e4feb356a6dc7fc185eeab17d67
Author: GuyBrush <miguel.ba...@live.com>
Date:   Sat Nov 23 14:13:10 2024 +0100

    runtime(netrw): Fixing powershell execution issues on Windows
    
    closes: https://github.com/vim/vim/issues/16094
    
    Signed-off-by: GuyBrush <miguel.ba...@live.com>

diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 629d35ea0..f920c64f8 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -37,6 +37,7 @@
 "   2024 Nov 10 by Vim Project: directory symlink not resolved in tree view 
(#16020)
 "   2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056)
 "   2024 Nov 23 by Vim Project: update decompress defaults (#16104)
+"   2024 Nov 23 by Vim Project: fix powershell escaping issues (#16094)
 "   }}}
 " Former Maintainer:   Charles E Campbell
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
@@ -11328,9 +11329,7 @@ endfun
 " ---------------------------------------------------------------------
 " s:NetrwExe: executes a string using "!" {{{2
 fun! s:NetrwExe(cmd)
-"  call Dfunc("s:NetrwExe(a:cmd<".a:cmd.">)")
-  if has("win32")
-"    call Decho("using win32:",expand("<slnum>"))
+  if has("win32") && exepath(&shell) !~? ' 
[\/]?(cmd|pwsh|powershell)(\.exe)?$' && !g:netrw_cygwin
     let 
savedShell=[&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash]
     set shell& shellcmdflag& shellxquote& shellxescape&
     set shellquote& shellpipe& shellredir& shellslash&
@@ -11340,13 +11339,11 @@ fun! s:NetrwExe(cmd)
       let 
[&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash]
 = savedShell
     endtry
   else
-"   call Decho("exe ".a:cmd,'~'.expand("<slnum>"))
    exe a:cmd
   endif
   if v:shell_error
    call netrw#ErrorMsg(s:WARNING,"shell signalled an error",106)
   endif
-"  call Dret("s:NetrwExe : v:shell_error=".v:shell_error)
 endfun
 
 " ---------------------------------------------------------------------

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tEpya-00GhjR-LP%40256bit.org.

Raspunde prin e-mail lui