Hi,

I think there are two issues here:

1. Select the console to send commands to.

Right now the logic is very simple: if the ipython console is visible, send commands there. If not, send commands to the python one. If both are visible (as in Jed's screenshot), commands are always going to be sent to the ipython console.

I agree with Pierre that the best thing to do is properly implement option 2. This would require to maintain a variable (probably in spyder.py) that keeps track of the currently focused console (python or ipython).

2. Decide what happens when the user is debugging and changes focus to another console.

@Jed: If the user only changes focus to the editor but don't move to another console, then (as things are right now) debug commands continue to be sent to the selected console (could you confirm it?). if that's not the case, then we must fix it because otherwise it'd be counterintuitive.

For the case I mentioned, I think we need to have a variable for each console to know if it is debugging state or not. This would let us avoid to send debug commands to non-debugging consoles.

Cheers,
Carlos

El 09/02/13 18:31, Jed Ludlow escribió:
I just committed a change that now makes the debugging toolbar commands work for all Spyder console types (excluding Spyder's own internal console, of course) [1]. That includes standard external Python consoles, IPython consoles attached to Spyder-controlled kernels, and IPython consoles attached to external kernels. Note that there are still some limitations with debugging in an external kernel. For example, breakpoints set in Spyder will not be active [2].In the process of implementing the feature, an important usability question came up.

Spyder allows you have multiple consoles open, and more than one of those could be running the current file in the editor. Furthermore, because the dock widgets can be moved from the main window, a window layout like the attached is possible. In fact, I know there are some of you who routinely pull the Console plugin outside like I've shown in the attached screenshot.

In that light, an ambiguity arises. If the current editor file is set to run in an existing Python interpreter, which of the two interpreters should it choose? Here are a couple of options:

 1. If only one console is visible, run in that one. If more than one
    type is visible, run in the IPython console. This is the current
    behavior. The IPython choice is kind of arbitrary and could be
    changed to default to the Python console.
 2. Require the user to set focus on one of the desired console before
    running or before sending a debug command.

The first option seems more convenient because you don't have to worry about widget focus, and it is actually a somewhat rare condition to have both consoles visible. And, under the layout in the screenshot, if you want to make sure everything goes to the Python console you simply hide the IPython console by hitting the History log tab. The second option seems the most general and has some intuitive appeal, but it might make things less convenient for the user because you have to keep setting focus.

I'm very much interested in your feedback about which of the two options you'd prefer. Please reply with thoughts.

[1] http://code.google.com/p/spyderlib/source/detail?r=34d9170d3bfb980e54a937ad86152f0ee03d629d

[2] http://code.google.com/p/spyderlib/issues/detail?id=1256#c6
--
You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to