Skip to content

Commit cc4f9d9

Browse files
On SIGCHLD do waitpid(-1). use the package 'waitpid'.
Not sure if there is a better way to handle this but this works. Related PR on pty.js : chjj/pty.js#37
1 parent 64719c0 commit cc4f9d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ var path = require('path');
55
var ws = require('websocket').server;
66
var pty = require('pty.js');
77
var fs = require('fs');
8+
var waitpid = require('waitpid');
9+
10+
process.on('SIGCHLD', function(args){
11+
waitpid(-1);
12+
});
813

914
var opts = require('optimist')
1015
.options({

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"express": "3.5.1",
66
"websocket": "",
77
"pty.js": "",
8-
"optimist": ""
8+
"optimist": "",
9+
"waitpid": ""
910
},
1011
"description": "Wetty = Web + tty. Terminal access in browser over http/https ",
1112
"main": "app.js",

0 commit comments

Comments
 (0)