dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

After executing command I am getting this issue(not using vorpal prompt) #59

Closed hiteshbal91 closed 8 years ago

hiteshbal91 commented 8 years ago
vorpal
    .command('connect [username] [password]')
    .description('Connect to server.')
    .action(function (args, callback) {
        setTimeout(function () {
            // deleting options key from args
            delete args.options;

            var context = domain.create();

            // error handling in domain
            context.on('error', errorHandler);

            // running the connect in domain
            context.run(function() {
                console.log("Arguments : ", args);
            });
        }, 0);
    });

vorpal
    .delimiter('hdb$')
    .show();

Vorpal Prompt error: TypeError: Cannot read property 'setRawMode' of null at ReadStream.setRawMode (tty.js:67:15) at Interface._setRawMode (readline.js:177:23) at new Interface (readline.js:137:10) at Object.exports.createInterface (readline.js:39:10) at Object.Interface.createInterface (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/node_modules/readline2/index.js:34:21) at module.exports (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/lib/ui/baseUI.js:14:30) at new module.exports (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/lib/ui/prompt.js:15:8) at Object.promptModule as prompt at Object.ui.prompt (/home/users/my-cli/node_modules/vorpal/lib/ui.js:171:25) at EventEmitter.vorpal._prompt (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:528:15) at EventEmitter. (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:542:12) at callback (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:705:22) at /home/users/my-cli/node_modules/vorpal/lib/vorpal.js:824:7 at EventEmitter._commandSetCallback (/home/users/my-cli/node_modules/vorpal/lib/session.js:455:5) at EventEmitter.session.completeCommand (/home/users/my-cli/node_modules/vorpal/lib/session.js:519:12) at onCompletion (/home/users/my-cli/node_modules/vorpal/lib/session.js:465:10)

Please let me know if I am doing something wrong in this.

dthree commented 8 years ago

Thanks. Could you please post this as a StackOverflow question? In this way, I can help others with an answer as well.

hiteshbal91 commented 8 years ago

​Hi Team,

http://stackoverflow.com/questions/34304036/after-successful-execution-of-vorpal-command-error-is-thrown

Please look into it ASAP.

Thanks.

Hitesh Baldaniya Application Engineer | @builtio

On Tue, Dec 15, 2015 at 11:23 PM, dc notifications@github.com wrote:

Thanks. Could you please post this as a StackOverflow http://stackoverflow.com/questions/tagged/vorpal.js question? In this way, I can help others with an answer as well.

— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/59#issuecomment-164839134.

dthree commented 8 years ago

Thanks!


I posted an answer.