[IPython-user] [IPython-dev] bug in coloured prompt
Thu Apr 5 02:46:51 CDT 2007
* Fernando Perez (Wed, 4 Apr 2007 10:36:35 -0600)
> On 4/4/07, Thorsten Kampe <firstname.lastname@example.org> wrote:
> > > We do have enough Win32 users that if you can find a patch that makes
> > > all combinations of terminals and environments under win32 work
> > > correctly, I'm sure it will be very welcome.
> > To be honest I don't think a patch to IPython would make sense. Other
> > applications have the same problem (lftp and yafc for instance) - and
> > probably the same cause for the problem. It wouldn't make sense to
> > patch all these apps. The only thing these applications have in common
> > is that they use Cygwin readline. I guess we have to patch readline.
> Well, IPython already has tons of workaround code to make sure users
> get the right experience even in the face of limitations in
> third-party code (bugs in python itself, windows, etc.). So I would
> not be against including something similar to help here, if it can be
> made robustly.
> But obviously if you can have Cygwin fixed for good, that's even better :)
I now received an answer from Eric Blake, the Cygwin readline
maintainer. Basically he says that the Prompt code in IPython (and the
other applications that have the problem) is buggy. Here's his main
> In other words, the common bug in all three programs you mentioned
> is that they copied bash's escape sequences, but NOT bash's round of
> internal expansion, prior to calling readline.
> Just because most other terminals (rxvt, xterm, ...) are tolerant of
> unknown control characters, and treat spurious invisible \001 as
> non-printing characters, doesn't mean that lftp, yafc, or IPython
> should assume that all terminals behave that way.
Could you have a look at this and see whether he's right or wrong?
The thread is at
Eric's answer is at
More information about the IPython-user