Skip to content

Commit 873530b

Browse files
committed
tst
1 parent d82e48d commit 873530b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ public static CommandLineBuilder CancelOnProcessTermination(
105105
}, (CancellationToken)default);
106106
}
107107
};
108-
Console.CancelKeyPress += consoleHandler;
109-
AppDomain.CurrentDomain.ProcessExit += processExitHandler;
108+
109+
if (!(cancelationProcessingTimeout! > TimeSpan.Zero))
110+
{
111+
Console.CancelKeyPress += consoleHandler;
112+
AppDomain.CurrentDomain.ProcessExit += processExitHandler;
113+
}
110114
};
111115

112116
try

0 commit comments

Comments
 (0)