diff options
Diffstat (limited to 'src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt')
-rw-r--r-- | src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt b/src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt index cec0b9e..bd72421 100644 --- a/src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt +++ b/src/main/kotlin/moe/nea89/website/ShellExecutionContext.kt @@ -35,15 +35,17 @@ class ShellExecutionContext( ) { console.state = KConsole.ConsoleState.IN_PROGRAM val se = ShellExecutionContext(console, name, args) - command.runner.createCoroutine(se, object : Continuation<Unit> { - override val context: CoroutineContext - get() = EmptyCoroutineContext + window.requestAnimationFrame { + command.runner.createCoroutine(se, object : Continuation<Unit> { + override val context: CoroutineContext + get() = EmptyCoroutineContext - override fun resumeWith(result: Result<Unit>) { - console.state = KConsole.ConsoleState.SHELLPROMPT - console.rerender() - } - }).resume(Unit) + override fun resumeWith(result: Result<Unit>) { + console.state = KConsole.ConsoleState.SHELLPROMPT + console.rerender() + } + }).resume(Unit) + } } } } |