add option O_NOCTTY to prevent terminal from hanging up

This commit is contained in:
AJ ONeal 2018-06-26 19:11:46 -06:00
parent 7406fad9e3
commit c77f8b6f15
1 changed files with 3 additions and 1 deletions

View File

@ -94,7 +94,9 @@ function askForConfig(answers, mainCb) {
answers = answers || {}; answers = answers || {};
//console.log("Please create a config file at '" + confpath + "' or specify --config /path/to/config"); //console.log("Please create a config file at '" + confpath + "' or specify --config /path/to/config");
var fs = require('fs'); var fs = require('fs');
var stdin = useTty ? fs.createReadStream('/dev/tty') : process.stdin; var stdin = useTty ? fs.createReadStream(null, {
fd: fs.openSync({ path: '/dev/tty', flags: fs.constants.O_WRONLY | fs.constants.O_NOCTTY })
}) : process.stdin;
var readline = require('readline'); var readline = require('readline');
var rl = readline.createInterface({ var rl = readline.createInterface({
input: stdin input: stdin