python / python/cpython

The New REPL Command History Does Not Honor Partial Text

Open
#120,767 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 3.14 topic-repl type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

Let's say I fire up the REPL and start with the following:

>>> spam = 1
>>> ham = 2
>>> eggs = 3
>>> sp

At that point, I can up-arrow to scroll through my REPL command history. Normally with that partial sp on the line, hitting up-arrow once will immediately present spam = 1. Hitting it again will do nothing (since there are no more matching lines).

With the new REPL, it presents eggs = 3. Hitting it again will present ham = 2, and again it presents spam = 1. I'd rather it keep doing what it did before.

CC @ambv, @pablogsal

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-121859

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the partial-input history behavior in the CPython main-branch REPL on Linux, using the sp example from the report. Compare up-arrow results with the expected prefix-filtered history behavior; the issue is resolved when only matching history entries are shown and unrelated entries are skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.