fixed termial newline handle
This commit is contained in:
parent
05a220110d
commit
182a2bce7d
@ -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) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user