From c176bb79ec5e1c30f3efcc90ca516613d48ed6cc Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 27 Apr 2023 00:00:59 +0200 Subject: [PATCH 1/2] gh-102628: Fix sqlite3 CLI promt text on Windows CTRL-Z is the Windows equivalent of CTRL-D. --- Lib/sqlite3/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py index f8a5cca24e56af..9f57e7d6d58c8c 100644 --- a/Lib/sqlite3/__main__.py +++ b/Lib/sqlite3/__main__.py @@ -94,12 +94,13 @@ def main(): db_name = repr(args.filename) # Prepare REPL banner and prompts. + eofkey = "CTRL-Z" if sys.platform == "win32" else "CTRL-D" banner = dedent(f""" sqlite3 shell, running on SQLite version {sqlite3.sqlite_version} Connected to {db_name} Each command will be run using execute() on the cursor. - Type ".help" for more information; type ".quit" or CTRL-D to quit. + Type ".help" for more information; type ".quit" or {eofkey} to quit. """).strip() sys.ps1 = "sqlite> " sys.ps2 = " ... " From cb09689ff05cf4c8bcbcc3463c7cd9bbe42cd05c Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 27 Apr 2023 00:06:25 +0200 Subject: [PATCH 2/2] Add NEWS --- .../next/Library/2023-04-27-00-05-32.gh-issue-102628.X230E-.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2023-04-27-00-05-32.gh-issue-102628.X230E-.rst diff --git a/Misc/NEWS.d/next/Library/2023-04-27-00-05-32.gh-issue-102628.X230E-.rst b/Misc/NEWS.d/next/Library/2023-04-27-00-05-32.gh-issue-102628.X230E-.rst new file mode 100644 index 00000000000000..eaaca5b41ba5e2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-04-27-00-05-32.gh-issue-102628.X230E-.rst @@ -0,0 +1,2 @@ +Substitute CTRL-D with CTRL-Z in :mod:`sqlite3` CLI banner when running on +Windows.