Don't print control characters in terminal
This commit is contained in:
parent
948fcc1c55
commit
fe6872d55b
|
@ -323,7 +323,8 @@ UART.prototype.write_data = function(out_byte)
|
|||
|
||||
if(char === "\n")
|
||||
{
|
||||
dbg_log("SERIAL: " + String.fromCharCode.apply("", this.current_line).trimRight());
|
||||
const line = String.fromCharCode.apply("", this.current_line).trimRight().replace(/[\x00-\x08\x0b-\x1f\x7f\x80-\xff]/g, "");
|
||||
dbg_log("SERIAL: " + line);
|
||||
this.bus.send("serial0-output-line", String.fromCharCode.apply("", this.current_line));
|
||||
this.current_line = [];
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ emulator.add_listener("serial0-output-char", function(chr)
|
|||
console.error("Serial: %s", line);
|
||||
line = "";
|
||||
}
|
||||
else
|
||||
else if(chr >= " " && chr <= "~")
|
||||
{
|
||||
line += chr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue