classification
Title: IDLE - an extension to clear the shell window
Type: enhancement Stage:
Components: IDLE Versions: Python 3.4, Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: roger.serwy Nosy List: rhettinger, roger.serwy, taleinat
Priority: normal Keywords:

Created on 2009-05-29 21:09 by roger.serwy, last changed 2013-04-04 13:46 by roger.serwy.

Files
File name Uploaded Description Edit
ClearWindow.py roger.serwy, 2009-05-29 21:09 ClearWindow extension
ClearWindow.py roger.serwy, 2009-06-15 05:13 Added Undo functionality
Messages (5)
msg88539 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2009-05-29 21:09
I noticed that the feature to clear the shell window has been a
discussion topic in the IDLE-dev archives for a few years. Here's an
extension that can clear the contents of the shell window. It provides
"Clear Shell Window" under "Options" and a <Ctrl-L> key binding.

The source code provides two methods to do this. The
ModifiedUndoDelegator prevents changing the contents of the text widget
before "iomark". One solution is to disable the filter, make the
changes, then re-enable it. Another solution is move "iomark" to the
beginning of the document. Any thoughts?
msg89319 - (view) Author: Tal Einat (taleinat) (Python committer) Date: 2009-06-13 10:26
First of all I think that the Squeezer (issue #1529353) extension is
more useful and solves most of the problems that this proposed feature
is set to solve, e.g. issue #1442493.


IMO the second method you offer - temporarily moving "iomark" - is
preferable.

One reason is that it will allow using the undo feature to undo deleting
the entire shell history. I think this is important since deleting the
history by accident without a way to retrieve it would be very annoying.

I propose going with the clear_window2 method, wrapping it with
undo_block_start() and undo_block_stop().
msg89387 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2009-06-15 05:13
I just tried Squeezer. It's pretty neat and it solves a different
problem. Clearing the contents of the shell window should be a simple
operation.

The undo operation doesn't restore iomark properly, nor does it restore
tags. I've uploaded a newer version of the extension to handle undo.

Binding to the "<<undo>>" virtual event with add="+" didn't work as
expected, so the new undo event handler explicitly calls the older one.
I admit that this code is not ideal.

Should I move this extension to the Cheese Shop and close out this issue?
msg185485 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2013-03-29 02:16
The ClearWindow.py extension as included in the IdleX package contains a more recent version that allows undo with full color tag restoration.
msg186033 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2013-04-04 13:46
In #17632, Raymond suggests adding a "Restart and Clear" menu item under the Shell menu.
History
Date User Action Args
2013-04-04 13:46:38roger.serwysetnosy: + rhettinger
messages: + msg186033
2013-04-04 13:45:43roger.serwylinkissue17632 superseder
2013-03-29 02:16:13roger.serwysetassignee: roger.serwy
messages: + msg185485
versions: + Python 2.7, Python 3.3, Python 3.4
2010-08-03 21:11:45terry.reedysettype: behavior -> enhancement
versions: - Python 2.6, Python 2.5, Python 3.0, Python 3.1, Python 2.7
2009-06-15 05:13:28roger.serwysetfiles: + ClearWindow.py

messages: + msg89387
2009-06-13 10:26:18taleinatsetnosy: + taleinat
messages: + msg89319
2009-05-29 21:09:50roger.serwycreate