This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: change recall in IDLE shell to not overwrite current command
Type: Stage:
Components: IDLE Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: kbk Nosy List: jshute, kbk, mdehoon
Priority: normal Keywords: patch

Created on 2005-05-06 21:55 by jshute, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
recall.patch jshute, 2005-05-06 21:55
Messages (3)
msg48306 - (view) Author: Jeff Shute (jshute) Date: 2005-05-06 21:55
Currently, when you move the cursor over any previous
command/output and press enter, IDLE replaces the
command you are currently typing with that text.  I
find this behaviour very annoying because I often end
up doing it by accident when I switch from another
window back to IDLE, and it cannot be undone, so I lose
whatever command I was building up.

This patch changes the behaviour so that instead of
replacing your current text with the text under the
cursor, the text under the cursor is inserted at the
current location, using the auto-indenter to make sure
it is put in the correct place.  The operation also
becomes undoable.

This allows sequences like the following:

>>> comp1()
5.436436
>>> comp2()
3.655546
>>> print 5.436436 + 3.655546
9.091982

where I have generated the third command like this:
print [up, up, up, enter] + [up, enter][enter]

or like this:
>>> for a in set1:
	for b in set2:
		print a,b

...
>>> for c in set3:
	for a in set1:
		for b in set2:
			print a,b

I generate the second command by typing the first line,
and then cursoring up to the previous command and
pressing enter.  The old loop is inserted properly
indented into the new loop.  (This does not work with
copy and paste.)  I can then continue to edit the
combined command or press enter to run it.
msg48307 - (view) Author: Michiel de Hoon (mdehoon) * Date: 2005-06-10 16:15
Logged In: YES 
user_id=488897

FWIW, I've tried this patch on Windows. I agree that it
makes IDLE easier to use. I'll write to python-dev in
support of this patch.
msg48308 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2005-06-19 18:57
Logged In: YES 
user_id=149084

PyShell.py Rev 1.97
Thanks for the patch!
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41956
2005-05-06 21:55:23jshutecreate