[Idle-dev] IDLE "shell" (was: IDLE interpreter window)

Guido van Rossum guido@python.org
Tue, 07 Mar 2000 17:35:38 -0500


> I think it would be better to "do the right thing" when they type in the
> existing buffer, rather than make it read-only.  For example, I often delete
> earlier text from these history windows.

I do that too, because I can, but I don't think I'll miss it much.

You can always close PyShell and open a new one.  (Maybe "reset"
should be a standard command.)

> Ive often thought that for Pythonwin, the preferred behaviour would be that
> as soon as someone starts editing a previous command, the entire command is
> copied to the end of the buffer, and edited in-place there - ie, simply
> remove the requirement that "Enter" copies the block to the end - make it
> _any_ editing character does this!

Not clear -- you could've accidentally moved the mouse away from the
command buffer; and what to do if something's already there?  I've
been observing newbies lately, and some quite clumsy with the mouse,
often clicking where they shouldn't.

> I also have a bit of a dilemma about what to do when someone presses enter
> while editing a command, but they are not at the end of that command.  Eg,
> Im entering a 5 line function, and I scroll up to change line 2, then press
> Enter.

In IDLE, it inserts a line at the insert point -- very handy if you
need to insert a line of code.  If that wasn't what you expected, undo
and hit DOWN until you're at the end, then hit return.  Newbies don't
mind this kind of stuff.

> > Those shell folks knew what they were doing!
> 
> I dunno - I think the editor window is far superior.  I wonder what these
> shells would look like had they been written when GUIs were ubiquitous?  I
> bet they would look different.  This is not to suggest that what we have is
> perfect, but IMO it is an improvement.

In the way that an Emacs shell buffer is an improvement over
bash-in-an-xterm.

> Anecdotally, Pythonwin is nearly 7 years old, and I have never one heard
> that the interactive window should "look like a shell".  I _have_ had a
> handful of comments that it should be harder to edit a previous command.

And that's the same feedback we're now getting about IDLE -- the "look
like a shell" thing is a red herring -- what they really want is that
the editability reflects how much sense it makes to change text; you
shouldn't be able to edit output or past commands, since you can't
rewrite history.

> Im thinking that styling could also be useful - eg, all previous text gets a
> grey background, while the text you edit at the end of the buffer is white.
> This could help reinforce the metaphor....

Good idea.  The foreground should continue to use syntax coloring and
the various color codings for stdout/stderr/IDLE diagnostics, of
course.

When should past output turn grey?  When the new prompt appears?  I
could experiment with that.

--Guido van Rossum (home page: http://www.python.org/~guido/)