Open HarelAshwal opened 7 years ago
If you want to disable CTRL+C you can remove all keypress listeners on process.stdin :
const listeners = process.stdin.removeAllListeners('keypress');
// You can restore them later
listeners.forEach(listener => process.stdin.addListener('keypress', listener));
See Node documentation for more information.
In addition to @MatthieuLemoine 's observations, it's also important to note that a vorpal app is actually a collection of vorpal instances. You can use the show and hide methods to get rid of the delimiter, while still keeping the app itself running, all without using the interrupt of Ctrl-C.
there's also this handler, but I am not sure if it will help
process.prependListener('SIGINT', function(){
});
it might be nice if vorpal would ignore SIGINT events with a boolean, something like this:
process.once('SIGINT', function(){
if(Vorpal.ignoreSIGINTEvents){
return;
}
});
LK"I
Hi All,
Have you ever considered adding the ability to disable/ignore Ctrl+C ? I'm having application that the management console should always active. (and exiting options should be disabled)
Harel