Skip to content

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

Open
L3viathan wants to merge 4 commits intopython:mainfrom
L3viathan:main
Open

gh-147950: Additionally bind yank-arg to M-_ in pyrepl#147949
L3viathan wants to merge 4 commits intopython:mainfrom
L3viathan:main

Conversation

@L3viathan
Copy link
Copy Markdown
Contributor

@L3viathan L3viathan commented Mar 31, 2026

(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
Copy link
Copy Markdown
Member

picnixz commented Mar 31, 2026

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
Copy link
Copy Markdown
Member

@picnixz picnixz left a comment

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.

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.

2 participants