[IPython-dev] [IPython-user] bug in coloured prompt

Fernando Perez fperez.net at gmail.com
Mon Apr 2 18:03:10 EDT 2007

On 4/2/07, Thorsten Kampe <thorsten at thorstenkampe.de> wrote:
> * Thorsten Kampe (Mon, 2 Apr 2007 08:59:15 +0100)
> > By the way (introducing a new bug(?): if I run Cygwin IPython (meaning
> > "Linux" Python and GNU readline) the output prompt shows the colour
> > escape sequences as coloured faces. This only happens with the
> > standard Windows console and the well-known "Console"[1].
> >
> > The paradox thing is that prompt_in1 and prompt_in2 display fine -
> > it's just prompt_out that has this mistake. Is there some special code
> > in IPython that constructs the in prompts differently than the out
> > prompt?!

Yes, the input prompts use InputTermColors; see ColorAnsi.py:


Perhaps those terminals, under windows, misinterpret escapes that
don't have the extra \001/\002 bracketing them.

Note that getting coloring to work at all under windows has been a
long and painful road (given the sorry status of terminal programs in
that platform), so I'm not terribly surprised to see there are still

We're too close to a release to change this in the trunk, but at least
knowing this, you can make a local change to test if adding those
escapes improves things for you.  If it does, with more time for
testing it could be applied everywhere as a win32-specific change, but
not now.



More information about the IPython-dev mailing list