From c77f8b6f15daf62defbdd4326b8a9d3ba6dd52e1 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 26 Jun 2018 19:11:46 -0600 Subject: [PATCH] add option O_NOCTTY to prevent terminal from hanging up --- bin/telebit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/telebit.js b/bin/telebit.js index ca99202..449d200 100755 --- a/bin/telebit.js +++ b/bin/telebit.js @@ -94,7 +94,9 @@ function askForConfig(answers, mainCb) { answers = answers || {}; //console.log("Please create a config file at '" + confpath + "' or specify --config /path/to/config"); 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 rl = readline.createInterface({ input: stdin