From 11da7fd58896b58d36d65a50c3c60bbb3bc3e5ea Mon Sep 17 00:00:00 2001 From: rnentjes Date: Fri, 15 Aug 2025 14:31:33 +0200 Subject: [PATCH] Add debug `println` statements in `Shell.execCommand` and adjust `ConsoleView` input handling --- src/commonMain/kotlin/mtmc/os/shell/Shell.kt | 2 ++ src/jsMain/kotlin/mtmc/view/ConsoleView.kt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/mtmc/os/shell/Shell.kt b/src/commonMain/kotlin/mtmc/os/shell/Shell.kt index 04d6c4f..8bfe267 100644 --- a/src/commonMain/kotlin/mtmc/os/shell/Shell.kt +++ b/src/commonMain/kotlin/mtmc/os/shell/Shell.kt @@ -77,6 +77,7 @@ object Shell { } fun execCommand(command: String, computer: MonTanaMiniComputer) { + println("Exec: $command") val tokens = MTMCTokenizer(command, "#") try { val identifier = tokens.matchAndConsume(MTMCToken.TokenType.IDENTIFIER) @@ -101,6 +102,7 @@ object Shell { if (isCommand(cmd)) { COMMANDS[cmd.lowercase()]!!.exec(tokens, computer) } else { + println("Executing: $command") tokens.reset() val asm = mutableListOf() asm.addAll(tokens.tokens) diff --git a/src/jsMain/kotlin/mtmc/view/ConsoleView.kt b/src/jsMain/kotlin/mtmc/view/ConsoleView.kt index a9037db..d68cf75 100644 --- a/src/jsMain/kotlin/mtmc/view/ConsoleView.kt +++ b/src/jsMain/kotlin/mtmc/view/ConsoleView.kt @@ -53,10 +53,10 @@ class ConsoleView( private fun handleCommand() { history.add(input) - input = "" Shell.execCommand(input, computer) + input = "" mainView.requestUpdate() }