gh-102628: Fix sqlite3 CLI prompt for Windows console users (#103898)

The prompt will still be incorrect in IDLE on Windows,
as IDLE uses CTRL-D for EOF on all platforms.
This commit is contained in:
Erlend E. Aasland 2023-04-27 21:23:10 +02:00 committed by GitHub
parent 44b5c21f41
commit 8def5ef016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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 = " ... "

View File

@ -0,0 +1,2 @@
Substitute CTRL-D with CTRL-Z in :mod:`sqlite3` CLI banner when running on
Windows.