mirror of
https://github.com/neovim/neovim.git
synced 2026-04-28 18:24:13 +00:00
feat(defaults): shelltemp=false #33012
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -642,7 +642,7 @@ function M.source(code)
|
||||
end
|
||||
|
||||
function M.has_powershell()
|
||||
return M.eval('executable("' .. (is_os('win') and 'powershell' or 'pwsh') .. '")') == 1
|
||||
return M.eval('executable("pwsh")') == 1
|
||||
end
|
||||
|
||||
--- Sets Nvim shell to powershell.
|
||||
@@ -655,7 +655,7 @@ function M.set_shell_powershell(fake)
|
||||
if not fake then
|
||||
assert(found)
|
||||
end
|
||||
local shell = found and (is_os('win') and 'powershell' or 'pwsh') or M.testprg('pwsh-test')
|
||||
local shell = found and 'pwsh' or M.testprg('pwsh-test')
|
||||
local cmd = 'Remove-Item -Force '
|
||||
.. table.concat(
|
||||
is_os('win') and { 'alias:cat', 'alias:echo', 'alias:sleep', 'alias:sort', 'alias:tee' }
|
||||
@@ -671,7 +671,7 @@ function M.set_shell_powershell(fake)
|
||||
let &shellcmdflag .= '$PSDefaultParameterValues[''Out-File:Encoding'']=''utf8'';'
|
||||
let &shellcmdflag .= ']] .. cmd .. [['
|
||||
let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'
|
||||
let &shellpipe = '2>&1 | %%{ "$_" } | tee %s; exit $LastExitCode'
|
||||
let &shellpipe = '> %s 2>&1'
|
||||
]])
|
||||
return found
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user