Skip to content

sqlite3 CLI keeps part of previous commands when scrolling history #135883

Closed

Description

@tanloong

Bug report

Bug description:

Enter the sqlite3 CLI on the main branch, type SELECT * FROM sqlite_master; , press enter. Then press <Up>, the history command SELECT * FROM sqlite_master; is displayed. And then press <Down>, the current line will be partially cleared, the SELECT * FR is left on the screen.

$ ./python -m sqlite3 
sqlite> SELECT * FROM sqlite_master;
sqlite> |
simplescreenrecorder-2025-06-24_17.33.25.mp4

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Jun 24, 2025
  2. LamentXU123 commented on Jun 25, 2025

    @LamentXU123
    Contributor

    When did the line SELECT * FR get input? Could you please provide the complete keyboard input to reproduce this? TiA

  3. tanloong commented on Jun 25, 2025

    @tanloong
    ContributorAuthor

    SELECT * FR isn't an actual input. That's the crux of the problem. It's part of a previous command that got left on the screen when you scroll through the history using the <up> and <down> keys.

    The keys shown in the bottom area of the screen recording are all the keyboard inputs. There's nothing else. Try it and you will be able reproduce the issue.

  4. added a commit that references this issue on Mar 3, 2026
  5. erlend-aasland commented on Mar 3, 2026

    @erlend-aasland
    Contributor

    The fix has landed in main, but I'll keep the issue open until the backports have landed.

  6. erlend-aasland commented on Mar 4, 2026

    @erlend-aasland
    Contributor

    No backports needed; marking as completed.

  7. moved this from In Progress to Done in sqlite3 issueson Mar 4, 2026
  8. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-sqlite3type-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions