Skip to content

gh-147950: Additionally bind yank-arg to M-_ in pyrepl#147949

Merged
chris-eibl merged 6 commits into
python:mainfrom
L3viathan:main
Jul 18, 2026
Merged

gh-147950: Additionally bind yank-arg to M-_ in pyrepl#147949
chris-eibl merged 6 commits into
python:mainfrom
L3viathan:main

Conversation

@L3viathan

@L3viathan L3viathan commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

(I think this is a trivial change, but if I'm mistaken I'm of course happy to create an issue for this after all.)

This change just additionally binds M-_ (or Meta-Underscore, or Escape-Underscore) to yank-arg; inserting the last word of the previous line. In GNU Readline there's two bindings for this, M-. and M-_ (and my muscle memory is unfortunately used to the latter).

Just like in readline, this does exactly the same thing as M-.
@picnixz

picnixz commented Mar 31, 2026

Copy link
Copy Markdown
Member

Let's have an issue (or re-use an old one if you can find one related to such changes) and add a NEWS entry as well. It's still a user-visible change somehow though minimal and could be considered a bugfix.

@L3viathan L3viathan changed the title _pyrepl: Add M-_ binding for yank-arg gh-147950: Additionally bind yank-arg to M-_ in pyrepl Mar 31, 2026
Comment thread Misc/NEWS.d/next/Library/2026-03-31-21-25-44.gh-issue-147950.5JR0sK.rst Outdated

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is fine but for posterity can you post the link motivating this change (that is, the link to the GNU docs that does this or give an HTML page that docs please?)

@L3viathan

Copy link
Copy Markdown
Contributor Author

It's mentioned in the docs for bash.

@picnixz

picnixz commented Apr 19, 2026

Copy link
Copy Markdown
Member

Please avoid updating the branch if the CI is ok. We just need to wait for a REPL maintainer to accept that change (cc @ambv, @pablogsal)

@chris-eibl
chris-eibl self-requested a review July 18, 2026 09:52

@chris-eibl chris-eibl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just talked to @ambv at the EuroPython 2026 sprints and this LGTU.

Thanks @L3viathan for your contribution!

@chris-eibl
chris-eibl merged commit ff56462 into python:main Jul 18, 2026
60 checks passed
@L3viathan

Copy link
Copy Markdown
Contributor Author

@chris-eibl Thanks, that's a nice goodbye present from Kraków for me :)

(on a plane back home)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants