From cc4f9d93daf4f5d93b2c10614721655c81a50625 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Sat, 3 May 2014 14:50:10 +0530 Subject: [PATCH] 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 : https://github.com/chjj/pty.js/pull/37 --- app.js | 5 +++++ package.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index a7200c6de..ea529c350 100644 --- a/app.js +++ b/app.js @@ -5,6 +5,11 @@ var path = require('path'); var ws = require('websocket').server; var pty = require('pty.js'); var fs = require('fs'); +var waitpid = require('waitpid'); + +process.on('SIGCHLD', function(args){ + waitpid(-1); +}); var opts = require('optimist') .options({ diff --git a/package.json b/package.json index 5acd6a1e5..3e997ec9c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "express": "3.5.1", "websocket": "", "pty.js": "", - "optimist": "" + "optimist": "", + "waitpid": "" }, "description": "Wetty = Web + tty. Terminal access in browser over http/https ", "main": "app.js",