IDLE: Better document close and exit. #89459
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = 'https://github.com/terryjreedy' closed_at = <Date 2022-01-27.03:56:18.530> created_at = <Date 2021-09-26.20:52:27.906> labels = ['expert-IDLE', 'type-bug', '3.9', '3.10', '3.11'] title = 'IDLE: Better document close and exit.' updated_at = <Date 2022-01-27.03:56:18.529> user = 'https://github.com/terryjreedy'
activity = <Date 2022-01-27.03:56:18.529> actor = 'terry.reedy' assignee = 'terry.reedy' closed = True closed_date = <Date 2022-01-27.03:56:18.530> closer = 'terry.reedy' components = ['IDLE'] creation = <Date 2021-09-26.20:52:27.906> creator = 'terry.reedy' dependencies =  files =  hgrepos =  issue_num = 45296 keywords = ['patch'] message_count = 12.0 messages = ['402678', '402689', '402693', '402697', '402768', '402773', '402774', '402775', '402820', '411829', '411832', '411834'] nosy_count = 5.0 nosy_names = ['terry.reedy', 'taleinat', 'lukasz.langa', 'miss-islington', 'epaine'] pr_nums = ['28577', '28600', '28601', '30936', '30944', '30945'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue45296' versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']
The text was updated successfully, but these errors were encountered:
On Windows: >>> exit 'Use exit() or Ctrl-Z plus Return to exit' >>> quit 'Use quit() or Ctrl-Z plus Return to exit' >>> exit.eof 'Ctrl-Z plus Return'
On *nix, 'Ctrl-Z plus Return' is 'Ctrl-D (i.e, EOF)'
Both exit and quit are instances of _sitebuiltins.Quitter
def __init__(self, name, eof):
self.name = name
self.eof = eof
return 'Use %s() or %s to exit' % (self.name, self.eof)
def __call__ [not relevant here]
We just need to replace current exit/quit.eof as indicated above on startup.
I doubt beginners care that it's EOF.
I'd be a lot more inclined towards this.
Is it worth considering changing this behaviour? IMO Ctrl-D is better for consistency between platforms, but wanted to throw the idea out there for discussion.
Unfortunately, I have discovered, the new wording is better but only correct for IDLE when Shell is the only window.
On the file menu, I want to:
Also, add a little in the doc entry for these choices. Or maybe open a separate issue to add the option name for all menu entry hotkeys that can be rebound. I don't know how many that is.
For a single window app, like the REPL, when not running in Command Prompt or the equivalent, closing the window and exiting the application are the same thing. The same is true when Shell is the only IDLE window. Closing Shell exits IDLE. After submitting the PR, I discovered that exit() and quit() only close Shell but do not exit IDLE if there are other windows. So the message should really be something like the following:
To close Shell, enter 'exit()', 'quit()', or 'Alt-F4'.
This requires replacing the __repr__ method. Someone who rebinds either hotkey option, which I expect is rare, will have to remember that they did so if that happen to enter either 'exit' or 'quit' without parens.
The question of IDLE on Windows and <^Z Return> was discussed some years ago on an issue a vaguely remember but could not find. It was decided to either not add it or maybe to remove it, and key cross-platform ^D for closing Shell (and only Shell as it does nothing in Editor). I don't want to change that decision.