Skip to content

Commit c0ab8ed

Browse files
committed
fix bug
1 parent 3d8f996 commit c0ab8ed

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyxtermjs/index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@
5353
term.writeln("Welcome to pyxterm.js!");
5454
term.writeln("https://github.com/cs01/pyxterm.js");
5555
term.onData((data) => {
56-
console.log("pressed key", data.input);
57-
socket.emit("pty-input", { input: data.input });
56+
console.log("new input data", data);
57+
socket.emit("pty-input", { input: data });
5858
});
5959

6060
const socket = io.connect("/pty");
6161
const status = document.getElementById("status");
6262

6363
socket.on("pty-output", function (data) {
64-
console.log("new output", data);
64+
console.log("new output received from server", data);
6565
term.write(data.output);
6666
});
6767

@@ -78,7 +78,9 @@
7878

7979
function fitToscreen() {
8080
fit.fit();
81-
socket.emit("resize", { cols: term.cols, rows: term.rows });
81+
const dims = { cols: term.cols, rows: term.rows };
82+
console.log("sending new dimensions to server's pty", dims);
83+
socket.emit("resize", dims);
8284
}
8385

8486
function debounce(func, wait_ms) {

0 commit comments

Comments
 (0)