Skip to content

Commit 1a98aa3

Browse files
committed
Fix keeping part of previous commands when scrolling history
1 parent 34393cb commit 1a98aa3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/sqlite3/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def main(*args):
132132
theme = get_theme()
133133
s = theme.syntax
134134

135-
sys.ps1 = f"{s.prompt}sqlite> {s.reset}"
136-
sys.ps2 = f"{s.prompt} ... {s.reset}"
135+
sys.ps1 = f"\001{s.prompt}\002sqlite> \001{s.reset}\002"
136+
sys.ps2 = f"\001{s.prompt}\002 ... \001{s.reset}\002"
137137

138138
con = sqlite3.connect(args.filename, isolation_level=None)
139139
try:

Lib/test/test_sqlite3/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ def test_interact_on_disk_file(self):
202202
def test_color(self):
203203
with unittest.mock.patch("_colorize.can_colorize", return_value=True):
204204
out, err = self.run_cli(commands="TEXT\n")
205-
self.assertIn("\x1b[1;35msqlite> \x1b[0m", out)
206-
self.assertIn("\x1b[1;35m ... \x1b[0m\x1b", out)
205+
self.assertIn("\001\x1b[1;35m\002sqlite> \001\x1b[0m\002", out)
206+
self.assertIn("\001\x1b[1;35m\002 ... \001\x1b[0m\002\001\x1b", out)
207207
out, err = self.run_cli(commands=("sel;",))
208208
self.assertIn('\x1b[1;35mOperationalError (SQLITE_ERROR)\x1b[0m: '
209209
'\x1b[35mnear "sel": syntax error\x1b[0m', err)

0 commit comments

Comments
 (0)