[IPython-dev] pyreadline refactor progess

Jörgen Stenarson jorgen.stenarson@bostream...
Fri Jul 4 15:52:05 CDT 2008


Fernando Perez skrev:
> Hey Jorgen,
> 
> What are your thoughts on this being workable as a full replacement
> for python's readline in text terminals?  There are platforms where
> readline continues to be a problem (until recently OSX, and John
> Hunter tells me his Solaris boxes never work quite right, for
> example).  It would be nice if ipython could use its own
> self-contained readline everywhere, with a uniform API for text
> consoles or GUIs.  But I don't know how to go about the work of
> trapping keyboard events in a text terminal (precisely what GNU
> readline does), and I don't feel like learning :)
> 

Fernando,

I think it should be possible, but I'm not at a position to do the 
terminal backend development myself (I'm only on windows currently). 
There is an ironpython backend in there but I haven't tried it for a 
long time so I'm not sure how well (if at all) it works now, there were 
some workarounds I had to do because the .NET console class does not 
implement the full windows console functionality.

As a longer term goal of the refactoring I should isolate the methods 
that are necessary for pyreadline to work from those that are included 
but not really necessary. This should make it easier to develop new 
backends by calrifying which methods are necessary for its functionality.

Perhaps it is possible to use the curses library on platforms where that 
is available but I have no idea how well that transmits the keystrokes 
and their interpretation for different locales etc.

/Jörgen


More information about the IPython-dev mailing list