Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: chjj/tty.js
base: 02e5dd5836
...
head fork: chjj/tty.js
compare: b760b3e2c4
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 12, 2012
@chjj improve daemonizer 752e577
@chjj v0.2.6 b760b3e
Showing with 6 additions and 16 deletions.
  1. +4 −12 lib/config.js
  2. +1 −1  package.json
  3. +1 −3 static/term.js
View
16 lib/config.js
@@ -213,30 +213,22 @@ function checkLegacy(conf) {
*/
function daemonize() {
- var argv = process.argv.slice();
+ if (process.env.IS_DAEMONIC) return;
- if (~argv.indexOf('--daemonized')) {
- return;
- }
-
- var spawn = require('child_process').spawn
+ var argv = process.argv.slice()
+ , spawn = require('child_process').spawn
, code;
- argv.push('--daemonized');
-
- // escape arguments
argv = argv.map(function(arg) {
arg = arg.replace(/(["$\\])/g, '\\$1');
return '"' + arg + '"';
}).join(' ');
- // fork with sh
- code = '(setsid ' + argv + ' > /dev/null 2>&1 &)';
+ code = '(IS_DAEMONIC=1 setsid ' + argv + ' > /dev/null 2>& 1 &)';
spawn('/bin/sh', [ '-c', code ]).on('exit', function(code) {
process.exit(code || 0);
});
- // kill current stack
process.once('uncaughtException', function() {});
throw 'stop';
}
View
2  package.json
@@ -2,7 +2,7 @@
"name": "tty.js",
"description": "A terminal for your browser",
"author": "Christopher Jeffrey",
- "version": "0.2.5",
+ "version": "0.2.6",
"main": "./index.js",
"bin": "./bin/tty.js",
"man": "./man/tty.js.1",
View
4 static/term.js
@@ -3890,7 +3890,5 @@ if (typeof module !== 'undefined') {
}
}).call(function() {
- return typeof window !== 'undefined'
- ? this || window
- : global;
+ return this || (typeof window !== 'undefined' ? window : global);
}());

No commit comments for this range

Something went wrong with that request. Please try again.