We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ebdd03 commit 6d76f10Copy full SHA for 6d76f10
lib/server/console.js
@@ -99,13 +99,15 @@
99
100
function execute(socket, command, cwd) {
101
var isDone,
102
- spawn = spawnify(command, {
+ spawn = spawnify(command, {
103
cwd: cwd()
104
- });
+ }),
105
+
106
+ kill = function() {
107
+ spawn.kill();
108
+ };
109
- socket.on('kill', function() {
- spawn.kill();
110
+ socket.once('kill', kill);
111
112
spawn.on('error', function(error) {
113
isDone = true;
@@ -127,6 +129,8 @@
127
129
});
128
130
131
spawn.on('close', function() {
132
+ socket.removeListener('kill', kill);
133
134
if (!isDone);
135
socket.emit('data', '');
136
0 commit comments