fixed termial newline handle

This commit is contained in:
Djeeberjr 2023-05-29 22:10:25 +02:00
parent 05a220110d
commit 182a2bce7d

View File

@ -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;
}
for (line in s.split("\n")) {
if (line == ""){
this.backlog.push("");
} else {
this.backlog[this.backlog.length - 1] += s;
}
}
this.requestRender();
},
onExit: (success:Bool) -> {