Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ericsnowcurrently opened this issue Jun 19, 2024 · 5 comments
Open

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

ericsnowcurrently opened this issue Jun 19, 2024 · 5 comments
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@ericsnowcurrently
Copy link
Member

ericsnowcurrently commented Jun 19, 2024

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

@ericsnowcurrently ericsnowcurrently added type-bug An unexpected behavior, bug, or error 3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell labels Jun 19, 2024
estyxx added a commit to estyxx/cpython that referenced this issue Jul 17, 2024
@cfbolz
Copy link
Contributor

cfbolz commented Jul 30, 2024

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

@ericsnowcurrently
Copy link
Member Author

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.

@lilydjwg
Copy link
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

@ambv
Copy link
Contributor

ambv commented Dec 23, 2024

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.

@A4-Tacks
Copy link

A4-Tacks commented Jan 2, 2025

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
Labels
3.13 bugs and security fixes 3.14 new features, bugs and security fixes topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants