Skip to content

Commit d5700f1

Browse files
fanoushthegecko
authored andcommitted
fix also cmd being empty on empty line
1 parent 8f0d900 commit d5700f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/rtt/web.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
// allow empty lines too
124124
// if (line_input.length) {
125125
term.write('\r\n');
126-
cmd = line_input;
126+
cmd = line_input + "\r\n";
127127
console.log('sending: \"' + line_input + '\"');
128128
line_input = "";
129129
//}
@@ -165,7 +165,7 @@
165165

166166
// send to target
167167
if (cmd.length) {
168-
cmdBytes = new TextEncoder().encode(cmd + "\r\n");
168+
cmdBytes = new TextEncoder().encode(cmd);
169169
ret = await rtt.write(0, cmdBytes);
170170
if (ret < 0)
171171
console.log("cannot write", cmdBytes, "chars");

0 commit comments

Comments
 (0)