diff --git a/src/bin/Terminal.hx b/src/bin/Terminal.hx index e802018..0a49471 100644 --- a/src/bin/Terminal.hx +++ b/src/bin/Terminal.hx @@ -117,11 +117,24 @@ class Terminal implements Process { ProcessManager.run(ps,{ args: commandArgs, onWrite: (s:String) -> { + if (s == "") { + return; + } + if (!hadInput) { + // Add a new line, so that the input is not on the same line as the command this.backlog.push(""); hadInput = true; } - this.backlog[this.backlog.length - 1] += s; + + for (line in s.split("\n")) { + if (line == ""){ + this.backlog.push(""); + } else { + this.backlog[this.backlog.length - 1] += s; + } + } + this.requestRender(); }, onExit: (success:Bool) -> {