On Thu, Feb 4, 2010 at 4:38 PM, Gazi Alankus <al...@gm...> wrote:
> Hi,
> I would like to be able to send ctrl+c to the interactive console and want
> it to throw a KeyboardInterrupt exception on the currently running Python
> code, like it does in Python's default interpreter. Right now, the only
> option is to terminate the console by pressing the red button.
> I checked out the code and will soon start trying to work on it, but I have
> zero experience with eclipse programming. I thought I would ask which one
> would be easier: to catch a hotkey, to put an icon on the console's toolbar,
> or to put a context menu entry. I'd appreciate any input to get me started
> in the right direction.
> One other thing:
> in com.python.pydev.interactiveconsole.EvaluateActionSetter,
> before onCreateActions, the comment reads: "This method associates Ctrl+new
> line with the evaluation of commands in the console.". Does that mean
> pressing ctrl+enter in the python editor is supposed to send the current
> line to the console? If so, that would be awesome. However when I press
> ctrl+enter that's not happening.
Actually, it's no longer bound to Ctrl+Enter, but Ctrl+Alt+Enter (see:
http://pydev.org/manual_adv_interactive_console.html )
As for sending a Ctrl+C, the problem isn't really on the Eclipse side
of things, but in the design of the interactive console: in Python,
only the main thread will catch signals, so, that's where you send the
Ctrl+C, but in the interactive console it'll only evaluate what you
send on a line by line basis, where the main thread is the actual
interactive console, so, I'm not sure how useful that'd be (or are you
just aiming at killing the process and providing a secondary option?)
The code to look at the Python side is pydevconsole.py (at
org.python.pydev/PySrc).
Cheers,
Fabio
|