From 3255b8a556d6f740a7acd577b8f0fc541c9fed3d Mon Sep 17 00:00:00 2001 From: Mao-Yining <101858210+mao-yining@users.noreply.github.com> Date: Sun, 21 Dec 2025 18:45:26 +0000 Subject: [PATCH] runtime(vim9): Reset pwsh and powershell in Open() relates: #17995 closes: #18986 Signed-off-by: Mao-Yining Signed-off-by: Christian Brabandt --- 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 a878c877c8..c022800352 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 -- 2.47.3