]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim9): Reset pwsh and powershell in Open()
authorMao-Yining <101858210+mao-yining@users.noreply.github.com>
Sun, 21 Dec 2025 18:45:26 +0000 (18:45 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Dec 2025 18:45:26 +0000 (18:45 +0000)
relates: #17995
closes:  #18986

Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/vim9.vim

index a878c877c8ac445a4a6a63ed012ff74e79a5e8bd..c02280035258f069a1b431d6e955eedd11277286 100644 (file)
@@ -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