bugfix for non-TTY case

This commit is contained in:
AJ ONeal 2017-03-26 01:38:23 -06:00
parent 6763d727f5
commit 91efb1bbf2
1 changed files with 2 additions and 3 deletions

View File

@ -37,6 +37,7 @@ var form = {
, _prompt: '' , _prompt: ''
, _input: [] , _input: []
, _inputIndex: 0 , _inputIndex: 0
, isTTY: rws.isTTY
, cursorTo: function (x, y) { , cursorTo: function (x, y) {
if ('number' !== typeof x || (0 !== x && !x)) { if ('number' !== typeof x || (0 !== x && !x)) {
throw new Error('cursorTo(x[, y]): x is not optional and must be a number'); throw new Error('cursorTo(x[, y]): x is not optional and must be a number');
@ -245,8 +246,6 @@ var form = {
var x; var x;
if (CTRL_C === ch) { if (CTRL_C === ch) {
console.log("");
console.log("received CTRL+C and quit");
process.exit(0); process.exit(0);
callback(new Error("cancelled")); callback(new Error("cancelled"));
} }
@ -313,7 +312,7 @@ var form = {
if (cbs.value) { if (cbs.value) {
ws._input = require('spliddit')(cbs.value); ws._input = require('spliddit')(cbs.value);
ws._inputIndex = ws.input.length; ws._inputIndex = ws._input.length;
callback(); callback();
return; return;
} }