diff --git a/examples/rtt/web.html b/examples/rtt/web.html
index 3de0878..8f24b5b 100644
--- a/examples/rtt/web.html
+++ b/examples/rtt/web.html
@@ -120,12 +120,10 @@
const printable = !ev.altKey && !ev.ctrlKey && !ev.metaKey;
if (ev.keyCode === 13) { // process newline
- if (line_input.length) {
- term.write('\r\n');
- cmd = line_input;
- console.log('sending: \"' + line_input + '\"');
- line_input = "";
- }
+ term.write('\r\n');
+ cmd = line_input + "\r\n";
+ console.log('sending: \"' + line_input + '\"');
+ line_input = "";
} else if (ev.keyCode === 8) { // process backspace
if (term._core.buffer.x > 0) {
term.write('\b \b');
@@ -164,7 +162,7 @@
// send to target
if (cmd.length) {
- cmdBytes = new TextEncoder().encode(cmd + "\r\n");
+ cmdBytes = new TextEncoder().encode(cmd);
ret = await rtt.write(0, cmdBytes);
if (ret < 0)
console.log("cannot write", cmdBytes, "chars");