Skip to content

Commit 7d928db

Browse files
Merge pull request butlerx#13 from lucamilanesio/master
Stabilise Wetty with regards to child process exits
2 parents da3a0d1 + b3d4b4c commit 7d928db

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ var pty = require('pty.js');
77
var fs = require('fs');
88
var waitpid = require('waitpid');
99

10-
process.on('SIGCHLD', function(args){
11-
waitpid(-1);
12-
});
13-
1410
var opts = require('optimist')
1511
.options({
1612
sslkey: {
@@ -129,11 +125,15 @@ wss.on('request', function(request) {
129125
rows: 30
130126
});
131127
}
128+
console.log((new Date()) + " PID=" + term.pid + " STARTED on behalf of user=" + sshuser)
132129
term.on('data', function(data) {
133130
conn.send(JSON.stringify({
134131
data: data
135132
}));
136133
});
134+
term.on('exit', function(code) {
135+
console.log((new Date()) + " PID=" + term.pid + " ENDED")
136+
})
137137
}
138138
if (!data)
139139
return;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"dependencies": {
55
"express": "3.5.1",
66
"websocket": "",
7-
"pty.js": "",
7+
"pty.js": "git+https://github.com/terryschen/pty.js",
88
"optimist": "",
99
"waitpid": ""
1010
},

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>wtf</title>
6+
<title>Wetty - The WebTTY Terminal Emulator</title>
77
<script src="/wetty/hterm_all.js"></script>
88
<script src="/wetty/hterm.js"></script>
99
<script src="/wetty/wetty.js"></script>

public/wetty/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>wtf</title>
6+
<title>Wetty - The WebTTY Terminal Emulator</title>
77
<script src="/wetty/hterm_all.js"></script>
88
<script src="/wetty/hterm.js"></script>
99
<script src="/wetty/wetty.js"></script>

0 commit comments

Comments
 (0)