Skip to content

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

Closed
@rodrigogiraoserrao

Description

@rodrigogiraoserrao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions