Fix Ctrl+C for WSL-side processes

This commit is contained in:
Frans van Dorsselaer committed 2026-09-19 12:42:34 +02:00
1 parent 5d5b717d7e
commit e5cb87f396
1 file changed
+3
+3
View File
@@ -97,6 +97,9 @@ static partial class Wsl
_ = startInfo.Environment.Remove("WSL_UTF8");
if (linux is not null)
{
// This ensures that Ctrl+C is handled by our parent process only and is not hijacked by wsl.exe.
startInfo.CreateNewProcessGroup = true;
startInfo.CreateNoWindow = true;
startInfo.ArgumentList.Add("--distribution");
startInfo.ArgumentList.Add(linux.Value.distribution);
startInfo.ArgumentList.Add("--user");