Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #58: high pressure system failure


comp / comp.lang.python / python repl vi mode line editing not working.

SubjectAuthor
* python repl vi mode line editing not working.Tobiah
+* Re: python repl vi mode line editing not working.Stefan Ram
|`- Re: python repl vi mode line editing not working.Tobiah
`- Re: python repl vi mode line editing not working.Tobiah

1
Subject: python repl vi mode line editing not working.
From: Tobiah
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Tue, 9 Jul 2024 13:15 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: toby@tobiah.org (Tobiah)
Newsgroups: comp.lang.python
Subject: python repl vi mode line editing not working.
Date: Tue, 9 Jul 2024 06:15:14 -0700
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <v6jd52$1cup4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 09 Jul 2024 15:15:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ca6f46cd88fdf95a23f94aecf29dcf4b";
logging-data="1473316"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+38sTo/ixONlvxl/dx+/A"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:zraWPqr77n12DxzKt1bYLbs78N0=
Content-Language: en-US
View all headers

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

Subject: Re: python repl vi mode line editing not working.
From: Stefan Ram
Newsgroups: comp.lang.python
Organization: Stefan Ram
Date: Tue, 9 Jul 2024 13:40 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: python repl vi mode line editing not working.
Date: 9 Jul 2024 13:40:43 GMT
Organization: Stefan Ram
Lines: 22
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <readline-20240709143958@ram.dialup.fu-berlin.de>
References: <v6jd52$1cup4$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de YoK9t5an9cYvF1pfTYcvKwTA0F/eawjfP4vjvGkmZSeXJj
Cancel-Lock: sha1:szAv/1/XDUv23raKCE0t5t1yG54= sha256:2Jkfu2KperCNMCI6G+rzPz1Z/PK8giOVP6e0n8VLX+Q=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
View all headers

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.

Subject: Re: python repl vi mode line editing not working.
From: Tobiah
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Wed, 10 Jul 2024 13:35 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: toby@tobiah.org (Tobiah)
Newsgroups: comp.lang.python
Subject: Re: python repl vi mode line editing not working.
Date: Wed, 10 Jul 2024 06:35:16 -0700
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <v6m2mk$1ttmi$1@dont-email.me>
References: <v6jd52$1cup4$1@dont-email.me>
<readline-20240709143958@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 10 Jul 2024 15:35:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d015df37ae2611975346a862643a4f7";
logging-data="2029266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cYgh/OGS+IMUpalRLiAfE"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:20daHb4ceBYGKWcs8Nt+tC7z0fE=
Content-Language: en-US
In-Reply-To: <readline-20240709143958@ram.dialup.fu-berlin.de>
View all headers

> 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.

Subject: Re: python repl vi mode line editing not working.
From: Tobiah
Newsgroups: comp.lang.python
Organization: A noiseless patient Spider
Date: Wed, 10 Jul 2024 13:44 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: toby@tobiah.org (Tobiah)
Newsgroups: comp.lang.python
Subject: Re: python repl vi mode line editing not working.
Date: Wed, 10 Jul 2024 06:44:50 -0700
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v6m38i$1ttmi$2@dont-email.me>
References: <v6jd52$1cup4$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 10 Jul 2024 15:44:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d015df37ae2611975346a862643a4f7";
logging-data="2029266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+67N9txa6aZAdW2MYGm93M"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IbUgf84oZTl8nTiPiamQJa7g+Cs=
In-Reply-To: <v6jd52$1cup4$1@dont-email.me>
Content-Language: en-US
View all headers

> 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.

1

rocksolid light 0.9.8
clearnet tor