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

Inconsistent behaviour for ALT+Enter keybinding in pyrepl, ipython and ptpython #121746

Closed
rodrigogiraoserrao opened this issue Jul 14, 2024 · 1 comment · Fixed by #121754
Closed
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@rodrigogiraoserrao
Copy link
Contributor

rodrigogiraoserrao commented Jul 14, 2024

Bug report

Bug description:

IPython and ptpython use ALT+Enter to submit multiline input, regardless of the position of the cursor, but the new REPL does not.
Looks like it'd be good to be consistent with those two multiline REPLs.

P.S.
The new REPL has a couple of similar bindings, but they all have issues:

  • ALT+Enter is commented out, so it's not being used (and it is pointing at the wrong command)
  • CTRL+J and CTRL+M are bound to the correct command but many terminals cannot tell those apart from \n and \r, unless they support a newer, more advanced terminal protocol (that must be explicitly enabled) (c.f. https://sw.kovidgoyal.net/kitty/keyboard-protocol/)
  • \<return> is bound to the correct command but it's not activated by the Enter key, it must be some obscure keybinding that I couldn't even figure out how to trigger.

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

macOS

Linked PRs

@rodrigogiraoserrao rodrigogiraoserrao added the type-bug An unexpected behavior, bug, or error label Jul 14, 2024
@Eclips4 Eclips4 added the topic-repl Related to the interactive shell label Jul 14, 2024
@rodrigogiraoserrao rodrigogiraoserrao changed the title Inconsistent behaviour for ALT+M keybinding in pyrepl, ipython and ptpython Inconsistent behaviour for ALT+Enter keybinding in pyrepl, ipython and ptpython Jul 14, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 15, 2024
)

(cherry picked from commit 6522f0e)

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
ambv pushed a commit that referenced this issue Jul 15, 2024
…H-121803)

(cherry picked from commit 6522f0e)

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
@ambv
Copy link
Contributor

ambv commented Jul 15, 2024

Thanks, Rodrigo! ✨ 🍰 ✨

estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants