Problem with exit command
When I set a simple standalone server, and try to connect to it with the vantage command line, the exit command breaks. It prints exit twice, but I only typed it once.
// Code
var vantageServer = vantage()
vantageServer.banner('Hello World');
vantageServer.listen(5111);
console.log('Vantage server started on port 5111');
// Error
Connecting to 127.0.0.1:5111 using http...
local@makawao~$ exit
local@makawao~$ exit
local@makawao~$ Prompt called when mid prompt...
/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/ui.js:130
throw new Error('UI Prompt called when already mid prompt.');
^
Error: UI Prompt called when already mid prompt.
at Object.ui.prompt (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/ui.js:130:13)
at EventEmitter.vorpal.prompt (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:457:8)
at EventEmitter.vorpal.exit (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:1032:12)
at CommandInstance.<anonymous> (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal-commons.js:48:19)
at EventEmitter.session.execCommandSet (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/session.js:412:24)
at EventEmitter.vorpal._exec (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:767:18)
at EventEmitter.vorpal._execQueueItem (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:607:10)
at EventEmitter.vorpal._queueHandler (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:591:10)
at Socket.<anonymous> (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/lib/client.js:236:37)
at Socket.Emitter.emit (/home/giodamelio/.nvm/versions/node/v4.0.0/lib/node_modules/vantage/node_modules/socket.io-client/node_modules/component-emitter/index.js:134:20)
K I'll check this out. Did some UI refactors recently so must have missed this.
Just to confirm, this is still present -
websvr~$ exit
websvr~$ exit
local@drupalvm~$ Prompt called when mid prompt...
/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/ui.js:140
throw new Error('UI Prompt called when already mid prompt.');
^
Error: UI Prompt called when already mid prompt.
at Object.ui.prompt (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/ui.js:140:13)
at EventEmitter.vorpal.prompt (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:468:17)
at EventEmitter.vorpal.exit (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:1073:12)
at CommandInstance.<anonymous> (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal-commons.js:48:19)
at EventEmitter.session.execCommandSet (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/session.js:432:24)
at EventEmitter.vorpal._exec (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:808:18)
at EventEmitter.vorpal._execQueueItem (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:619:10)
at EventEmitter.vorpal._queueHandler (/usr/local/lib/node_modules/vantage/node_modules/vorpal/lib/vorpal.js:603:10)
at Socket.<anonymous> (/usr/local/lib/node_modules/vantage/lib/client.js:236:37)
at Socket.Emitter.emit (/usr/local/lib/node_modules/vantage/node_modules/socket.io-client/node_modules/component-emi
tter/index.js:134:20)
Okay thanks. I semi-recently did a very large refactor on Vorpal (Vantage extends Vorpal), and under this was a large re-factor that was done on Inquirer, which is the the prompting / ui library under both of these. I've also been finalizing Vorpal's API.
The point of this is that once these changes are applied to Vantage, it's going to totally break it.
This isn't that big of a deal, it just means I am going to need to jump all the way in and get Vantage up to date with all of the other changes before I can fix the point in this issue.
Trying to get to this as soon as possible!