summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-04-27 19:23:10 (GMT)
committerGitHub <noreply@github.com>2023-04-27 19:23:10 (GMT)
commit8def5ef0160979c05a20f35b143d2314e639982b (patch)
treea6d5b21275641ff06f7fd7844a61f56057b8f089 /Lib/sqlite3
parent44b5c21f4124f9fa1312fada313c80c6abfa6d49 (diff)
downloadcpython-8def5ef0160979c05a20f35b143d2314e639982b.zip
cpython-8def5ef0160979c05a20f35b143d2314e639982b.tar.gz
cpython-8def5ef0160979c05a20f35b143d2314e639982b.tar.bz2
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.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/__main__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/sqlite3/__main__.py b/Lib/sqlite3/__main__.py
index f8a5cca..9f57e7d 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 = " ... "