mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 06:10:30 +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) {
|
Runtime.getRuntime().addShutdownHook(thread(start = false) {
|
||||||
MiraiConsole.stop()
|
MiraiConsole.stop()
|
||||||
|
MiraiConsoleTerminalUI.exit()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
|
|||||||
emptyCommand()
|
emptyCommand()
|
||||||
}
|
}
|
||||||
KeyType.Escape -> {
|
KeyType.Escape -> {
|
||||||
exitProcess(0)
|
exit()
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
if (keyStroke.character != null) {
|
if (keyStroke.character != null) {
|
||||||
@ -649,6 +649,12 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
|
|||||||
}
|
}
|
||||||
redrawLogs(log[screens[currentScreenId]]!!)
|
redrawLogs(log[screens[currentScreenId]]!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun exit() {
|
||||||
|
terminal.exitPrivateMode()
|
||||||
|
terminal.close()
|
||||||
|
exitProcess(0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user