Commit 9828bbf6 authored by jiahua.liu's avatar jiahua.liu

mirai console shutdown logic

parent e284267d
...@@ -23,6 +23,7 @@ class MiraiConsoleTerminalLoader { ...@@ -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 { ...@@ -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 { ...@@ -649,6 +649,12 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
} }
redrawLogs(log[screens[currentScreenId]]!!) redrawLogs(log[screens[currentScreenId]]!!)
} }
fun exit() {
terminal.exitPrivateMode()
terminal.close()
exitProcess(0)
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment