You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
(Optional/recommended) Move aside your history file for exact reproducibility, as this occurs regardless of history
mv ~/.pythonhist{,.bak}
Run bpython, and input at least the first line of any multi-line form
❯ bpython
bpython version 0.24 on top of Python 3.11.7 ...
>>> def foo():
...
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
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.
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.
The text was updated successfully, but these errors were encountered:
Just expressing support that I'd really love to see this added sometime, it's a feature of ptpython that I find incredibly useful, and considering bpython is generally faster for me + its history autocomplete/autofill feature is invaluable when doing a lot of testing, it'd be the one thing really solidifies it as the best Python REPL for me to finally have both of those features in one.
(This complements #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
bpython
, and input at least the first line of any multi-line formExpected
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
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.
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.
The text was updated successfully, but these errors were encountered: