Skip to content

Commit

Permalink
fix also cmd being empty on empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
fanoush authored Sep 5, 2024
1 parent c882b1e commit ebfe8f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/rtt/web.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
// allow empty lines too
// if (line_input.length) {
term.write('\r\n');
cmd = line_input;
cmd = line_input + "\r\n";
console.log('sending: \"' + line_input + '\"');
line_input = "";
//}
Expand Down Expand Up @@ -165,7 +165,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");
Expand Down

0 comments on commit ebfe8f9

Please sign in to comment.