|  | @@ -191,7 +191,7 @@ export class DOMConsole {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    async _appendText (text, type, newLine = false) {
 | 
	
		
			
				|  |  | -    console.debug("Caling appendText");
 | 
	
		
			
				|  |  | +    // console.debug("Caling appendText");
 | 
	
		
			
				|  |  |      const write_time = Date.now();
 | 
	
		
			
				|  |  |      this.pending_writes.push(0);
 | 
	
		
			
				|  |  |      await Utils.sleep(5);
 | 
	
	
		
			
				|  | @@ -209,7 +209,7 @@ export class DOMConsole {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      this.currentLine.innerHTML += this.getOutputText(text);
 | 
	
		
			
				|  |  |      if (newLine) {
 | 
	
		
			
				|  |  | -      console.debug("append newline");
 | 
	
		
			
				|  |  | +      // console.debug("append newline");
 | 
	
		
			
				|  |  |        this.currentLine = null;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      this.scrollTerm();
 | 
	
	
		
			
				|  | @@ -228,6 +228,9 @@ export class DOMConsole {
 | 
	
		
			
				|  |  |      textDiv.classList.add(divClass);
 | 
	
		
			
				|  |  |      if (filter) textDiv.innerHTML = this.getOutputText(text);
 | 
	
		
			
				|  |  |      else textDiv.innerHTML = `<span>${text}</span>`;
 | 
	
		
			
				|  |  | +    if (this.currentLine != null && this.currentLine.innerHTML.length === 0) {
 | 
	
		
			
				|  |  | +      this.termDiv.removeChild(this.currentLine);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      this.termDiv.insertBefore(textDiv, this.inputDiv);
 | 
	
		
			
				|  |  |      this.currentLine = null;
 | 
	
		
			
				|  |  |      this.scrollTerm();
 | 
	
	
		
			
				|  | @@ -365,22 +368,21 @@ export class DOMConsole {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    sendOutput (text) {
 | 
	
		
			
				|  |  | -    // console.debug(text);
 | 
	
		
			
				|  |  | +    //console.debug(text);
 | 
	
		
			
				|  |  |      let output = "" + text;
 | 
	
		
			
				|  |  |      if (output.indexOf("\n") !== -1) {
 | 
	
		
			
				|  |  | -      // console.debug("newline");
 | 
	
		
			
				|  |  | +      //console.debug("newline");
 | 
	
		
			
				|  |  |        const outputList = output.split("\n");
 | 
	
		
			
				|  |  |        let i = 0;
 | 
	
		
			
				|  |  |        for (; i < outputList.length - 1; i += 1) {
 | 
	
		
			
				|  |  | -        // console.debug("newline write");
 | 
	
		
			
				|  |  | +        //console.debug("newline write");
 | 
	
		
			
				|  |  |          let t = outputList[i];
 | 
	
		
			
				|  |  |          t = t.replace(/\t/g, "  ");
 | 
	
		
			
				|  |  |          t = t.replace(/\s/g, " ");
 | 
	
		
			
				|  |  | -        if (t.length == 0) {
 | 
	
		
			
				|  |  | -          // t = " ";
 | 
	
		
			
				|  |  | -          // console.debug('Empty string');
 | 
	
		
			
				|  |  | -          this.currentLine = null;
 | 
	
		
			
				|  |  | -        } else this.write(t, true);
 | 
	
		
			
				|  |  | +        if (t.length !== 0) {
 | 
	
		
			
				|  |  | +          this.write(t);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        this.write("", true);
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |        let t = outputList[i];
 | 
	
		
			
				|  |  |        t = t.replace(/\t/g, "  ");
 | 
	
	
		
			
				|  | @@ -390,7 +392,7 @@ export class DOMConsole {
 | 
	
		
			
				|  |  |        // console.debug("no newline");
 | 
	
		
			
				|  |  |        output = output.replace(/\t/g, "  ");
 | 
	
		
			
				|  |  |        output = output.replace(/\s/g, " ");
 | 
	
		
			
				|  |  | -      this.write(output);
 | 
	
		
			
				|  |  | +      if (output.length != 0) this.write(output);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 |