Skip to content

Commit

Permalink
Merge pull request #324 from HollowMan6/terminal-Exit
Browse files Browse the repository at this point in the history
Terminal: Close terminal buffer with EXIT signal
  • Loading branch information
MatthewZMD authored Jul 3, 2020
2 parents b4e2d15 + 57546b3 commit c0b1486
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/terminal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@

window.addEventListener("resize", sendSizeToServer);
}
socket.onclose = () => {}

socket.onmessage = (msg) => {
if(msg==="Closing"){
socket.close();
}
}

socket.onclose = () => {
window.close();
}
socket.onerror = () => {}
</script>
</body>
Expand Down
4 changes: 3 additions & 1 deletion app/terminal/server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
this.Pty = require("node-pty");
this.Websocket = require("ws").Server;

this.onclosed = () => {};
this.onclosed = () => {
ws.send("Closing");
};
this.onopened = () => {};
this.onresize = () => {};
this.ondisconnected = () => {};
Expand Down

0 comments on commit c0b1486

Please sign in to comment.