This commit is contained in:
Felipe Gasper
2017-09-11 00:01:07 -04:00
parent e442512087
commit 91aa8c51fc
4 changed files with 68 additions and 8 deletions
+1 -1
View File
@@ -29,6 +29,7 @@ app.post('/terminals', function (req, res) {
var cols = parseInt(req.query.cols),
rows = parseInt(req.query.rows),
term = pty.spawn(process.platform === 'win32' ? 'cmd.exe' : 'bash', [], {
encoding: null,
name: 'xterm-color',
cols: cols || 80,
rows: rows || 24,
@@ -63,7 +64,6 @@ app.ws('/terminals/:pid', function (ws, req) {
ws.send(logs[term.pid]);
term.on('data', function(data) {
console.log("From PTY: ", escape(data) );
try {
ws.send(data);
} catch (ex) {