Skip to content

@terryjreedy bpo-45296: Fix exit/quit message on Windows #28577

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

Merged
merged 2 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/idlelib/pyshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
HOST = '127.0.0.1' # python execution server on localhost loopback
PORT = 0 # someday pass in host, port for remote debug capability

try: # In case IDLE started with -n.
eof = 'Ctrl-D (end-of-file)'
exit.eof = eof
quit.eof = eof
except NameError: # In case python started with -S.
pass

# Override warnings module to write to warning_stream. Initialize to send IDLE
# internal warnings to the console. ScriptBinding.check_syntax() will
# temporarily redirect the stream to the shell window to display warnings when
Expand Down
7 changes: 7 additions & 0 deletions Lib/idlelib/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@

LOCALHOST = '127.0.0.1'

try:
eof = 'Ctrl-D (end-of-file)'
exit.eof = eof
quit.eof = eof
except NameError: # In case subprocess started with -S (maybe in future).
pass


def idle_formatwarning(message, category, filename, lineno, line=None):
"""Format warnings the IDLE way."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On Windows, change exit/quit message to suggest Ctrl-D, which works, instead
of <Ctrl-Z Return>, which does not work in IDLE.