runtime(vim9): Reset pwsh and powershell in Open()

Commit: 
https://github.com/vim/vim/commit/3255b8a556d6f740a7acd577b8f0fc541c9fed3d
Author: Mao-Yining <[email protected]>
Date:   Sun Dec 21 18:45:26 2025 +0000

    runtime(vim9): Reset pwsh and powershell in Open()
    
    relates: https://github.com/vim/vim/issues/17995
    closes:  https://github.com/vim/vim/issues/18986
    
    Signed-off-by: Mao-Yining <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim
index a878c877c..c02280035 100644
--- a/runtime/autoload/dist/vim9.vim
+++ b/runtime/autoload/dist/vim9.vim
@@ -126,6 +126,11 @@ export def Open(file: string)
     &shellslash = false
     defer setbufvar('%', '&shellslash', true)
   endif
+  if &shell == 'pwsh' || &shell == 'powershell'
+    const shell = &shell
+    setlocal shell&
+    defer setbufvar('%', '&shell', shell)
+  endif
   Launch($"{Viewer()} {shellescape(file, 1)}")
 enddef
 

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vXOex-008vgg-EK%40256bit.org.

Raspunde prin e-mail lui