[Idle-dev] Where to send patches?

Roger Serwy roger.serwy at gmail.com
Sun Apr 27 20:13:15 CEST 2008

Hi Everybody,

I submitted the patch to bugs.python.org under ID 2704. "IDLE: Patch to 
make PyShell behave more like a Terminal interface". Hopefully I can 
justify why these changed are needed.

This patch tries to make the PyShell behavior approach Terminal-like 
behavior in two ways, but still preserving some old behavior.

Firstly, if the cursor is after the "iomark", then PyShell will behave 
like an expected terminal, where up/down scrolls through the command 
history. However, if the cursor should leave the command line area, then 
it will behave as it does now.

The cursor can leave the command line area by pressing Pg-Up, or 
Pg-Down, clicking somewhere else in the window, or by pressing 
Left-Arrow" at the start of the command line. This is different from 
rebinding the keys using the Options->Configure Idle->Keys because if 
the cursor is anywhere on the window, pressing up or down will place the 
cursor back at the command line. That rebinding "breaks" the ability to 
use the arrow keys to find a line in the PyShell window and press enter 
to copy it.

Secondly, if the PyShell window has focus, then keyboard letter/number 
input should be sent to the command line. The ModifiedUndoDelegator 
ignores keys when the cursor is before the iomark. Instead it should 
place the cursor at the end of the command line and insert the key press 
there. This is expected of a terminal. Too often I find myself switching 
between Editor windows and the PyShell window with the mouse, and unless 
I bring focus to PyShell by clicking the title bar or the command line 
area, the cursor moves somewhere else in the window and PyShell ignores me.

I hope that this wasn't too much information. I really want to help make 
IDLE a more powerful Python editor, but still keep it simple.



Tal Einat wrote:
> Roger Serwy wrote:
>> Hi Everybody,
>>  I wrote a patch to make PyShell's input behave more like a "shell window",
>> where up/down key strokes go through the command history and all text input
>> is sent to the current command line. Who should I send this to?
> Hi Roger, welcome to the IDLE mailing list!
> The first thing is to with a patch is to discuss it with this list :)
> Changing IDLE's interface so that the arrow keys scroll through the
> history can be done in the configuration dialog: Options -> Configure
> IDLE ... -> Keys. However, moving the cursor around the window is very
> useful and much more intuitive for novice programmers, so we want this
> to be the default behavior. FYI, if the cursor is on a line/block of
> previously run code, pressing Enter will copy/paste the code into the
> current command line, and pressing Enter once more will run it again
> as-is.
> As for the change that all text input be redirected to the current
> command line - where in the command line? Always the end? Explaining
> what kind of behavior you want, and why, before sending a patch could
> save some work for all of us.
> In any case, if/when you want to submit a patch, you can submit the
> patch to the CPython issue tracker at bugs.python.org. Just register a
> user there (if you don't have one), then select "New Issue" under
> "Issues" in the navigation bar. Give the issue an informative name,
> something with "IDLE" in it which describes your patch's purpose, and
> please also select IDLE in the Components box. You can then also write
> to this mailing list if you want some people to try it out and discuss
> it.
> - Tal
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> http://mail.python.org/mailman/listinfo/idle-dev

More information about the IDLE-dev mailing list