vorpal icon indicating copy to clipboard operation
vorpal copied to clipboard

Importing Cash module causes issue with Vorpal / Command history not working

Open mke66djx opened this issue 7 years ago • 3 comments

Hi guys,very confusing- running the below seems to interfere with the main vorpal instance. I dont see how that's possible unless they use the same cache or other common files.

If you run the below and hit up and down you will see the history not working. Removing the cash import will fix the issue.

const Vorpal = require('vorpal'); const mainScreenVorpal = new Vorpal(); const cash = require('cash'); mainScreenVorpal .delimiter('home-mode~>') .history('mainScreenId') .show();

mke66djx avatar May 19 '17 23:05 mke66djx

Is there a use case for multiple Vorpal instances?

milesj avatar May 25 '17 06:05 milesj

Yes, in my case I have different user modes which each have their own command sets and workspaces. Vorpal was actually designed with this use case in mind.

mke66djx avatar May 25 '17 06:05 mke66djx

Not sure is anyone is using any extensions because I dont see much activity here but it looks like simply running .use(cash) is generating an error;

...node_modules\vorpal\dist\history.js:146 this._localStorage.setItem(this._storageKey, JSON.stringify(persistedHistory));

TypeError: Converting circular structure to JSON

Is anyone else getting this to work?

mke66djx avatar Jun 19 '17 21:06 mke66djx