Description
Bug report
Bug description:
Hi Python devs,
Trying out the new 3.13 REPL(love the improvement!) I faced a behaviour bump on my setup: I configure readline to be in vi editing mode, having a single set editing-mode vi
line on my ~/.inputrc
-- I'm running macOS 12.7.4 but the same behaviour is observed on Linux.
Observed behaviour:
- Launch python REPL with
python
. - Prompt is coloured, as expected.
- Type in
import sys
. - Hit
ESC
thenk
-- the equivalent of "give me the previous line". - Nothing happens.
- Hit the up arrow, instead.
- This time the previous line,
import sys
, is restored.
Expected behaviour -- hitting ESC
then k
should restore the previous line and, in general, hitting ESC
should go into "vi command mode" (not sure how this will work with multi-line history entries, but that is yet to be explored).
However:
- When running with
PYTHON_BASIC_REPL=1
the vi mode line editing works.
Since I'm running macOS and it does not ship readline, I figured I needed a better diagnostic (not sure if www.python.org's macOS Python bundles it -- it seems so, but I digged deeper).
On a Rocky Linux 9 host:
- Cloned the
git
repo. - Checked out the
3.13
branch. - Installed all lib dependencies including
readline-devel
. - Built commit
c4b853f2a5a4601806f503f1833dce3a4e8d2b58
:$ ./configure --with-pydebug $ make -s -j2
- The resulting
./python
executable shows the same behaviour -- readline's vi editing mode does not seem to be respected.
I did not look deeper into the code but I will be glad to assist in the diagnostic/fixing of this -- hoping that going forward, with a more powerful REPL, I can still leverage my finger memory from years of using vi.
Thanks again.
CPython versions tested on:
3.13
Operating systems tested on:
Linux, macOS