9

The sequences control+r and fn+delete that used to do recursive search / delete the following character do not work anymore in python 2.7 / Mac OSX Lion. Instead, a ~ appears each time I use fn+delete. I am using readline for tab completion (which also had to be changed according to python tab completion Mac OSX 10.7 (Lion)). Any ideas how to fix it?

Thanks, Bruno

2 Answers 2

3

According to http://pypi.python.org/pypi/readline:

"Mac OS X, do not ship with GNU readline installed. The readline extension module in the standard library of Mac "system" Python uses NetBSD's editline (libedit) library instead, which is a readline replacement with a less restrictive software license."

So, you can install it with the command:

sudo easy_install readline

Else, you can use tcsh shortcuts; control + d to delete the following character and Ecp + p for history search.

0
1

For recursive search you can configure libedit by adding following line to ~/.editrc

bind ^R em-inc-search-prev

or right from your .pystartup file

readline.parse_and_bind("bind ^R em-inc-search-prev")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.