Skip to content

The New REPL Command History Does Not Honor Partial Text #120767

Open

Description

@ericsnowcurrently

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

Activity

  1. added
    type-bug
    3.13
    3.14
    topic-repl
    on Jun 19, 2024
  2. cfbolz commented on Jul 30, 2024

    @cfbolz
    Contributor

    this is not the default behaviour of readline everywhere, I think. I have the same behaviour, but only because I put the following lines into my .inputrc:

    "\e[A": history-search-backward
    "\e[B": history-search-forward
    
  3. ericsnowcurrently commented on Jul 30, 2024

    @ericsnowcurrently
    MemberAuthor

    Good point. I have the same in my .inputrc. I suppose the operative word there is "search" (rather than "traverse").

    Perhaps this issue might be as much a feature request as a bug, e.g. "make the new REPL match readline behavior in this one way". In the end I reported it as a bug because, from a user standpoint, the behavior I was used to went away.

  4. lilydjwg commented on Dec 23, 2024

    @lilydjwg
    Contributor

    I have other things in my .inputrc and it's not available in new repl too:

    set show-all-if-unmodified on
    set colored-completion-prefix On
    
  5. ambv commented on Dec 23, 2024

    @ambv
    Contributor

    There are no plans to replicate all .inputrc options in the new REPL. You can use the basic REPL if you rely on specific .inputrc customizations.

  6. A4-Tacks commented on Jan 2, 2025

    @A4-Tacks

    There are no plans to replicate all .inputrc options in the new REPL. You can use the basic REPL if you rely on specific .inputrc customizations.

    May I ask how to use basic REPL? on my terminal

    Ok PYTHON_BASIC_REPL=1 python

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

    3.133.14topic-repltype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions