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

gh-120767: Add REPL history navigation with partial text #121859

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

estyxx
Copy link

@estyxx estyxx commented Jul 16, 2024

cc @pablogsal

These changes add support for navigating the REPL history with the up arrow key based on partial text in the buffer.

When partial text is in the buffer, the up arrow key will navigate through history entries that start with this partial text.

Example:

>>> spam = 1
>>> ham = 2
>>> eggs = 3
>>> sp
<arrow-up>

This correctly shows spam = 1.

With the following history:

>>> a=1111
>>> a=111
>>> a=11
>>> a=1

Typing a= and pressing the up arrow key will correctly navigate to a=1 and up.

Preserving existing behaviour

The standard navigation remains intact, ensuring that pressing the up arrow key without partial text continues to retrieve the most recent history entry. For example:

>>> 1+1
>>> 2+2

first <arrow-up> shows 2+2, second <arrow-up> shows 1+1.

Copy link

cpython-cla-bot bot commented Jul 16, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Jul 16, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

4 similar comments
@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

This changes add supports to navigate the history with arrow up
based on partial text in the buffer
@bedevere-app
Copy link

bedevere-app bot commented Jul 17, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant