-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDLE: Better document close and exit. #89459
Comments
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 Lines 13 to 26 in e14d5ae
class Quitter(object): def __init__(self, name, eof): self.name = name self.eof = eof def __repr__(self): 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. |
Tal, Paine: should be use exactly the raw REPL message or something that might be clearer to beginners, like 'Ctrl-D (end-of-file)'? |
How about "Control-D (end-of-file, a.k.a. EOF)" or even just "Control-D"? |
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. |
The wording chosen by Terry, i.e. "Ctrl-D (end-of-file)", is pretty clear. Merged and fixed. Thanks! |
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. |
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
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: