Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Oct 2010 15:11:23 +0200 (CEST)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-python@FreeBSD.ORG
Subject:   python27 + readline: can't bind ^U
Message-ID:  <201010211311.o9LDBNSp037399@lurza.secnetix.de>

next in thread | raw e-mail | index | archive | help
Hi,

I'm using python27 on FreeBSD 8.1.  I would like to change
the behaviour of ^U at the Python prompt.  By default, it
deletes everything to the left of the cursor, but I want
it to delete the _whole_ line, regardless of the current
cursor position.

Nothing of the following works:

 - adding one of these lines to ~/.inputrc:
   "\C-u": kill-whole-line
   Control-u: kill-whole-line

 - adding "import readline" and one of these lines to
   ~/.pythonstartup:
   readline.parse_and_bind (r'"\C-u": kill-whole-line')
   readline.parse_and_bind (r'Control-u: kill-whole-line')

The desired binding is never executed.  When I run the
"dump-functions" command, kill-whole-line is listed as
unbound, and \C-u is still bound to unix-line-discard.

Other key bindings that I added to ~/.pythonstartup and
~/.inputrc work fine.  Only Control-U refuses to be bound
to anything else than unix-line-discard.

What am I doing wrong?

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

One Unix to rule them all, One Resolver to find them,
One IP to bring them all and in the zone to bind them.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010211311.o9LDBNSp037399>