File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,23 @@ private static int Compare(Audio r1, Audio r2)
41
41
[ JsonSerializable ( typeof ( MyOption ) ) ]
42
42
partial class MyOptionJsonContext : JsonSerializerContext { }
43
43
44
+ private static void Console_CancelKeyPress ( object ? sender , ConsoleCancelEventArgs e )
45
+ {
46
+ LogWarn ( "Force Exit..." ) ;
47
+ try
48
+ {
49
+ Console . ResetColor ( ) ;
50
+ Console . CursorVisible = true ;
51
+ if ( ! OperatingSystem . IsWindows ( ) )
52
+ System . Diagnostics . Process . Start ( "stty" , "echo" ) ;
53
+ }
54
+ catch { }
55
+ Environment . Exit ( 0 ) ;
56
+ }
44
57
45
58
public static async Task < int > Main ( params string [ ] args )
46
59
{
60
+ Console . CancelKeyPress += Console_CancelKeyPress ;
47
61
ServicePointManager . DefaultConnectionLimit = 2048 ;
48
62
49
63
var rootCommand = CommandLineInvoker . GetRootCommand ( DoWorkAsync ) ;
@@ -211,6 +225,8 @@ private static async Task DoWorkAsync(MyOption myOption)
211
225
Config . COOKIE = myOption . Cookie ;
212
226
Config . TOKEN = myOption . AccessToken . Replace ( "access_token=" , "" ) ;
213
227
228
+ if ( interactMode ) hideStreams = false ; //手动选择时不能隐藏流
229
+
214
230
if ( ! string . IsNullOrEmpty ( myOption . WorkDir ) )
215
231
{
216
232
//解释环境变量
You can’t perform that action at this time.
0 commit comments