mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 07:30:09 +08:00
mirai console shutdown logic
This commit is contained in:
parent
e284267d47
commit
9828bbf694
@ -23,6 +23,7 @@ class MiraiConsoleTerminalLoader {
|
||||
}
|
||||
Runtime.getRuntime().addShutdownHook(thread(start = false) {
|
||||
MiraiConsole.stop()
|
||||
MiraiConsoleTerminalUI.exit()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
|
||||
emptyCommand()
|
||||
}
|
||||
KeyType.Escape -> {
|
||||
exitProcess(0)
|
||||
exit()
|
||||
}
|
||||
else -> {
|
||||
if (keyStroke.character != null) {
|
||||
@ -649,6 +649,12 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
|
||||
}
|
||||
redrawLogs(log[screens[currentScreenId]]!!)
|
||||
}
|
||||
|
||||
fun exit() {
|
||||
terminal.exitPrivateMode()
|
||||
terminal.close()
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user