From 9c91d02fa263e8cb0999758fd3866d029d87cb6b Mon Sep 17 00:00:00 2001 From: Mao-Yining Date: Sun, 21 Dec 2025 11:27:32 +0800 Subject: [PATCH] runtime(vim9): Reset pwsh and powershell in Open() relates: #17995 Signed-off-by: Mao-Yining --- runtime/autoload/dist/vim9.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime/autoload/dist/vim9.vim b/runtime/autoload/dist/vim9.vim index fa14bdaf04761f..56ab0604a2f836 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