fix(windows): treat any non-cmd shell as powershell like in selector

This commit is contained in:
Adam Wolski 2023-03-15 09:18:52 +01:00 committed by Amaan Qureshi
parent 677dd11c6a
commit 273d5e9ac5

View file

@ -318,10 +318,10 @@ end
---@return string command
function M.make_directory_change_for_command(dir, command)
if fn.has "win32" == 1 then
if vim.o.shell == "powershell" or vim.o.shell == "pwsh" then
return string.format("pushd %s ; %s ; popd", cmdpath(dir), command)
else
if string.find(vim.o.shell, "cmd") ~= nil then
return string.format("pushd %s & %s & popd", cmdpath(dir), command)
else
return string.format("pushd %s ; %s ; popd", cmdpath(dir), command)
end
else
return string.format("cd %s;\n %s", dir, command)