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

Thorsten Kampe thorsten@thorstenkampe...
Wed Apr 4 03:59:52 CDT 2007


* Fernando Perez (Tue, 3 Apr 2007 22:14:22 -0600)
> On 4/3/07, Thorsten Kampe <thorsten@thorstenkampe.de> wrote:
> > * Fernando Perez (Tue, 3 Apr 2007 11:03:12 -0600)
> > > On 4/3/07, Thorsten Kampe <thorsten@thorstenkampe.de> wrote:
> > > > Where would I have to make the change? In class TermColors?
> > >
> > > Yes, try to make it similar to InputTermColors and see what happens.
> >
> > Oooooops, it's actually the other way round: if I remove the \001/\002
> > from "class InputTermColors" then the outprompt (and the inprompts
> > still, too) looks fine.
> 
> Ah, OK.
> 
> > My conclusion: readline may use those \001 \002 to "properly know the
> > length of each line and can wrap lines accordingly" but some Windows
> > terminals can't interpret them (or they don't ignore them like they
> > should or readline doesn't "eat" them like it should).
> >
> > Now the question is: why do Windows cmd and Console together with
> > Cygwin Python and readline have a problem with those "\001 \002" pairs
> > and why do Windows cmd and Console together with Windows Python and
> > pyreadline not?!
> 
> I don't know.
> 
> If I was in a snotty mood, I'd say that the bug is not /in/ Windows,
> but that Windows /IS/ the bug.  But that would be mean :)

Yes, and incorrect. I guess it's a readline issue (even though rxvt 
doesn't have the problem) because the Windows Terminals work fine with 
"your" pyreadline.
 
> 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.
 
> And also, any patch for this should be *strictly* confined to win32,
> since all terminals work fine under *nix in all its flavors (as far as
> I know).

Win32 is fine, really. The "OS" (sys.platform) in question is Cygwin.


Thorsten



More information about the IPython-dev mailing list