• python repl vi mode line editing not working.

    From Tobiah@21:1/5 to All on Tue Jul 9 06:15:14 2024
    Kubuntu 24.04.


    sinewave:toby ~(1)> cat .inputrc
    set editing-mode vi
    set keymap vi
    sinewave:toby ~(1)> cat .editrc
    bind -v
    bind \\t rl_complete
    sinewave:toby ~(1)> python
    Python 2.7.18 (default, Jul 8 2024, 12:49:12)
    [GCC 13.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    1
    1
    2
    2
    ^[k


    I see the literal 'escape' character + 'k', when it should
    let me edit previous commands.

    I did have to compile my own python because I'm using 2.7 on
    this machine.

    Thanks for any help.


    Toby

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Tobiah on Tue Jul 9 13:40:43 2024
    Tobiah <toby@tobiah.org> wrote or quoted:
    1
    1
    2
    2
    ^[k

    Works here under a Linux with Python 3. I add the lines from
    your rc files to my rc files, call "python3", and then I see

    1
    |1
    2
    |2
    2

    after pressing [1][enter][2][enter][escape][k].

    (It seems Python 2 is not available to me on this system.)

    For this to work, the Python implementation should use the same
    readline library as your shell, I guess.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tobiah@21:1/5 to All on Wed Jul 10 06:44:50 2024
    I see the literal 'escape' character + 'k', when it should
    let me edit previous commands.

    I did have to compile my own python because I'm using 2.7 on
    this machine.


    I figured it out. I needed to apt install libreadline-dev.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tobiah@21:1/5 to All on Wed Jul 10 06:35:16 2024
    For this to work, the Python implementation should use the same
    readline library as your shell, I guess.

    It works in python3, so I guess my problem is that I'm
    compiling python (I think kubuntu dropped python2), but
    I don't see any relevant options in the configure help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)