mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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:
parent
44b5c21f41
commit
8def5ef016
2 changed files with 4 additions and 1 deletions
|
@ -94,12 +94,13 @@ def main():
|
||||||
db_name = repr(args.filename)
|
db_name = repr(args.filename)
|
||||||
|
|
||||||
# Prepare REPL banner and prompts.
|
# Prepare REPL banner and prompts.
|
||||||
|
eofkey = "CTRL-Z" if sys.platform == "win32" else "CTRL-D"
|
||||||
banner = dedent(f"""
|
banner = dedent(f"""
|
||||||
sqlite3 shell, running on SQLite version {sqlite3.sqlite_version}
|
sqlite3 shell, running on SQLite version {sqlite3.sqlite_version}
|
||||||
Connected to {db_name}
|
Connected to {db_name}
|
||||||
|
|
||||||
Each command will be run using execute() on the cursor.
|
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()
|
""").strip()
|
||||||
sys.ps1 = "sqlite> "
|
sys.ps1 = "sqlite> "
|
||||||
sys.ps2 = " ... "
|
sys.ps2 = " ... "
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Substitute CTRL-D with CTRL-Z in :mod:`sqlite3` CLI banner when running on
|
||||||
|
Windows.
|
Loading…
Add table
Add a link
Reference in a new issue