From e2ab296e799afe63d267b45ebd6b9a249acb2fe2 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Mon, 29 Jan 2024 00:10:21 +0100 Subject: [PATCH] added terminal args for runnig command on start --- src/bin/Terminal.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bin/Terminal.hx b/src/bin/Terminal.hx index 5c7bb6f..9da60ab 100644 --- a/src/bin/Terminal.hx +++ b/src/bin/Terminal.hx @@ -1,5 +1,6 @@ package bin; +import kernel.EndOfLoop; import lua.NativeStringTools; import kernel.binstore.BinStore; import kernel.ps.ProcessHandle; @@ -75,6 +76,15 @@ class Terminal implements Process { })); this.requestRender(); + + if (handle.args.length > 0) { + var arg1 = handle.args[0]; + + this.backlog.push("> " + arg1); + EndOfLoop.endOfLoop(() -> { + this.invokeCommand(arg1); + }); + } } private function stopCurrentPS() {