Closed scotthovestadt closed 8 years ago
Haha - someone filed the behavior you're requesting as a bug, so I changed it from the default.
I have a method called vorpal.sigint(function() { })
, where you can make sigint do whatever you want. Is this fine?
Yikes - I guess I didn't document that...
I'm actually going to do more mature things - I'm going to add functionality to break a current command with control+c, which will optionally fire a method (like command.sigint
or command.break
), and cut execution of that command.
What do you think?
Makes total sense to me. Just tested and it does feel odd to drop the delimiter after a single ctrl-c. Should require a double-tap.
Yeah, adding a listener so people can exit if they feel like it works for me.
Does Ctrl-C not end the command for you? It does for me.
Single Ctrl + C:
I'm okay with a double-tap by default - but what should the first tap do? I could do something like:
(^C again to quit)
How does that sound?
First tap should quit back to the delimiter. Second tap should exit to shell/command prompt.
So to start with you'd quit out of whatever you're doing and it would come up with, like, myapp$. The second tap it should quit you out of Vorpal entirely.
and if you're already on the delimiter..
Yeah, but I mean if a process is running. It should quit out of the process. Then, if you're on the delimiter it should quit back to shell. Does that make sense?
Yeah. Okay cool.
Sorry, I'd help if I could but I haven't had the experience with the code-base you have. I'll keep playing with it and experimenting with it, don't worry :). :8ball:
Haha no probs :)
I think it should mimic the NodeJS shell by default. One ctrl+c should automatically break whatever command you're typing if you have anything typed. If your command string is empty, it should say (^C again to quit)
and then a second ctrl+c should exit.
Deal.
Done :smiley:
It's feel natural, like you're in a terminal. People are going to expect it to work this way (like the NodeJS shell).