-
Notifications
You must be signed in to change notification settings - Fork 42.9k
Open
Description
In neovim/neovim#36881, documentation was added to show how to use powershell.exe (or pwsh.exe) as the shell. I have ported the VimScript to Lua:
if vim.fn.has("win32") == 1 then
vim.o.shelltemp = false
local shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command "
shellcmdflag = shellcmdflag .. "[Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();"
shellcmdflag = shellcmdflag .. "$PSDefaultParameterValues['Out-File:Encoding']='utf8';"
vim.o.shellpipe = "> %s 2>&1"
vim.o.shellquote = ""
vim.o.shellxquote = ""
if vim.fn.executable("pwsh.exe") == 1 then
vim.o.shell = "pwsh.exe"
shellcmdflag = shellcmdflag .. "$PSStyle.OutputRendering = 'PlainText';"
vim.env.__SuppressAnsiEscapeSequences = "1"
else
vim.o.shell = "powershell.exe"
end
vim.o.shellcmdflag = shellcmdflag
endymich9963
Metadata
Metadata
Assignees
Labels
No labels