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

relates: #17995
closes:  #18986

Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Mao-Yining
2025-12-21 18:45:26 +00:00
committed by Christian Brabandt
parent d57b4a3681
commit 3255b8a556
+5
View 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