Skip to content

Commit f061713

Browse files
authored
feat: use different remove command for windows power shell (#262) (#264)
Co-authored-by: Denzel <>
1 parent f1f917b commit f061713

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lua/cmake-tools/terminal.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ local is_fish_shell = function()
551551
return string.find(shell, "fish")
552552
end
553553

554+
local is_power_shell = function()
555+
return vim.o.shell == "pwsh"
556+
end
557+
554558
---creates command that handles all of our post command stuff for on_exit handling
555559
---@return string
556560
local get_command_handling_on_exit = function()
@@ -567,7 +571,7 @@ local get_command_handling_on_exit = function()
567571

568572
if osys.iswin32 then
569573
exit_op = "%errorlevel%"
570-
escape_rm = " del /Q "
574+
escape_rm = is_power_shell() and "Remove-Item " or "del /Q "
571575
exit_code_file_path = exit_code_file_path:gsub("/", "\\")
572576
lock_file_path = lock_file_path:gsub("/", "\\")
573577
end

0 commit comments

Comments
 (0)