I was wondering if anybody familiar with the workings of console.handle_ctrlkey() and console.ctrlkey_passthru might be able to
give me a little bit of an explanation as to the actual functionality of both of them.
Basically, I've had the problem in debugging my current work on a JavaScript shell that infinite loops and any sort of bugs arising from improper testing for user input, etc, are requiring me to actually
terminate the connection in order to recover from. For what it's worth, I've been testing this shell as an external program, just for ease of configuration, as I
see it.
Is there a set of options or enabling of the handlers indicated by .handle_ctrlkey() that will allow, say, the default of ^C to interrupt
my shell completely, or to drop me back to an aforementioned
function/method or other control structure within it? Sorry, I am finding the bits in http://synchro.net/docs/jsobjs.html#console a little ambiguous. :(
Any assistance is much appreciated, as well as any meta explanation of how this is documented that I might be missing... It appears that
something is missing in how I'm reading the dox, I guess. :P
The Ctrl-C key will, by default, set the SS_ABORT flag in the bbs.sys_status variable, so if you have a loop, you can check this flag (or the console.aborted property) to terminate the loop when set.
For example:
while(!console.aborted) {
// get input, do stuff
}
I was wondering if anybody familiar with the workings of console.handle_ctrlkey() and console.ctrlkey_passthru might be able to
give me a little bit of an explanation as to the actual functionality of both of them.
Basically, I've had theproblem in debugging my current work on a JavaScript shell that infinite loops and any sort of bugs arising from impropertesting for user input, etc, are requiring me to actually
terminate the connection in order to recover from. For what it's worth, I've been testing this shell as an external program, just for ease of configuration, as I
see it.
Is there a set of options or enabling of the handlers indicated by .handle_ctrlkey() that will allow, say, the default of ^C to interrupt
my shell completely, or to drop me back to an aforementioned
function/method or other control structure within it? Sorry, I am finding the bits in http://synchro.net/docs/jsobjs.html#console a little ambiguous. :(
Any assistance is much appreciated, as well as any meta explanation of how this is documented that I might be missing... It appears that
something is missing in how I'm reading the dox, I guess. :P
Sysop: | MCMLXXIX |
---|---|
Location: | Prospect, CT |
Users: | 325 |
Nodes: | 10 (0 / 10) |
Uptime: | 12:46:39 |
Calls: | 510 |
Messages: | 220577 |