Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multi-line editing #1013

Open
Open
@jab

Description

@jab

(Thiscomplements#22, it is not a duplicate.)

While inputting a multi-line form (e.g. a function or class), bpython does not let me cursor back to a previous line (e.g. to fix a typo).

Note, this is orthogonal and complementary to working with multi-line entries from history, which is already tracked by#22.

Repro

  1. (Optional/recommended) Move aside your history file for exact reproducibility, as this occurs regardless of history
mv ~/.pythonhist{,.bak}
  1. Runbpython, and input at least the first line of any multi-line form
❯ bpythonbpython version 0.24 on top of Python 3.11.7 ...>>> def foo():...
  1. Try to navigate back to the previous line (e.g. via Up arrow or Ctrl+P, or by pressing Alt+B multiple times to jump backward by word, which works across lines in other REPLs such as IPython)

Expected

You can move the cursor to the previous line (and then make any necessary changes to it before going back to the next line).

Observed

You can't move the cursor to a previous line. It stays stuck in the current line.

Prior Art

This works in other REPLs such as IPython:

Screen.Recording.2024-03-26.at.10.48.58.AM.mov

Workarounds

  1. Press C-x to open the current block in your default text editor.

Besides requiring extra steps/friction and being less discoverable, a major downside of this workaround is that, if your text editor opens "on top of" bpython in the same terminal (e.g. you use vim, you're not in a GUI environment where your editor can open in a new desktop window, etc.), then you lose the context of your previous input in your bpython session, which you may need to refer to for your current input.

  1. Press F7 to open the current session in your default text editor.

This avoids the loss of context of the C-x workaround, but still requires more steps and mental overhead to make a simple change like a typo fix to the previous line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp