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

Albert Brandl Albert.Brandl@edvg.co.at
Wed, 8 Mar 2000 10:22:40 +0100


>OK, here's a patch.  It was remarkably simple.

Remarkable indeed!

>The following patch prevents all editing from having any effect before
>the "I/O mark" -- an invisible marker in the text that delineates the
>beginning of the command editing area, typically placed just after the
>last prompt.  You can still steer the cursor anywhere in the window
>(unlike with a typical bash-in-an-xterm setup) but you can't type (or
>delete or cut or paste) when you're not in the command area.
>
>Please try this out, and let me know how it "feels"!

It already "feels" better, since it prevents most of the annoying errors
resulting from editing portions of the screen other than the command.

There are still some differences from the way shells usually behave.
Most importantly, I think that the arrow keys should be restricted
similar to the backspace key. They should only move around in the current
command and / or the command history (beware that multi-line commands need
some special care). It's e.g. strange to press Shift-Ctrl-A and see the
selection expand to the beginning of the line (including the Prompt).

I'd like to close with an unqualified remark on the class design:

On the long run, a seperate class for handling the user input might pay off.
It could be some kind of state machine with knowledge on the position of the
cursor, the bounds of the command line, the history and so on. This seems
more natural to me than intercepting the input and throwing it away under
certain circumstances. Furthermore, it would allow for easy adaption to
different preferences (e.g. vi-like vs. readline- or Emacs-like
"look-and-feel").

Of course, I have no idea if this idea fits into the concepts used so far.
If it does not, just forget about it ;-)

     Yours,

          Albert