Short of using gdb or mdb (or Visual Studio's debugger), there's no way to interrupt a tight loop in the Node REPL. For normal, asynchronous code on a Unixy system (including OS X) that may not be returning you back to a prompt, you can run "kill -USR1 <node pid>" to turn on the V8 debugger in the running Node process and then "node debug -p <node pid>" to attach a debugger REPL to the process.
Node's REPL isn't as friendly about this as a lot of other languages' REPLs, though. The best experience I've had is using mdb to control V8's execution from the native code (C++) level, but getting up and running with it isn't simple (there's a lot to learn!), and requires you to be running SmartOS or some other Solaris-like system. I do know that some people have had luck with the JS debugger in the WebStorm IDE, but I don't know if it will handle your specific issue any better than the Node debugger, because it's still just running the V8 debugger protocol under the hood. Sorry and good luck! F On Tue, Jan 14, 2014 at 11:06 PM, Dzmitry Litskalau <[email protected]>wrote: > For example type in node console: > > while(true) console.log('waiting please'); > > How stop it? CTRL-C not work. CTRL-BREAK close console (and all my work is > lost). > > I want ability to break a script execution in any time and get the stack > trace for point were a break happened. > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
