处理用户`Ctrl+C` 显示光标
This commit is contained in:
parent
a13d3c1f7a
commit
3a9784a5f9
|
@ -21,6 +21,7 @@ namespace N_m3u8DL_RE
|
|||
{
|
||||
static async Task Main(string[] args)
|
||||
{
|
||||
Console.CancelKeyPress += Console_CancelKeyPress;
|
||||
ServicePointManager.DefaultConnectionLimit = 1024;
|
||||
try { Console.CursorVisible = true; } catch { }
|
||||
string loc = "en-US";
|
||||
|
@ -44,6 +45,13 @@ namespace N_m3u8DL_RE
|
|||
await CommandInvoker.InvokeArgs(args, DoWorkAsync);
|
||||
}
|
||||
|
||||
private static void Console_CancelKeyPress(object? sender, ConsoleCancelEventArgs e)
|
||||
{
|
||||
Logger.WarnMarkUp("Force Exit...");
|
||||
try { Console.CursorVisible = true; } catch { }
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
static int GetOrder(StreamSpec streamSpec)
|
||||
{
|
||||
if (streamSpec.Channels == null) return 0;
|
||||
|
|
Loading…
Reference in New Issue