Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Generally kill both parent and their child processes. #1232

Merged
merged 1 commit into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Microsoft.Tye.Core/ProcessExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static void RunProcessAndWaitForExit(string fileName, string arguments, T
}
else
{
process?.Kill();
process?.Kill(entireProcessTree: true);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.Tye.Core/ProcessUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static async Task<ProcessResult> RunAsync(
{
if (!process.CloseMainWindow())
{
process.Kill();
process.Kill(entireProcessTree: true);
}
}

Expand All @@ -177,7 +177,7 @@ public static async Task<ProcessResult> RunAsync(

if (!process.HasExited)
{
process.Kill();
process.Kill(entireProcessTree: true);
}
}
}
Expand All @@ -197,7 +197,7 @@ public static void KillProcess(int pid)
try
{
using var process = Process.GetProcessById(pid);
process?.Kill();
process?.Kill(entireProcessTree: true);
}
catch (ArgumentException) { }
catch (InvalidOperationException) { }
Expand Down