[IPython-user] Re: Incomplete color support in IPython 0.6.0.

Fernando Perez fperez at colorado.edu
Sat May 15 14:27:32 CDT 2004

Hi all,

Thorsten Kampe wrote:
> * Vincent N. Virgilio (2004-05-15 09:26 +0100)


Bummer!  It seems like I'm never going to be able to get true Windows support 
done right. You have obviously followed all instructions to the letter, so I'm 
at a loss as to what the problem may be.

Googling around, I found this message from Gary which may help:

In particular, please try the following with all the codes as you currently 
have them (ipython and Gary's readline):

- quoting Gary:
On Windows, a user may optionally include the following in his IPYTHONDIR


'''Turn on the translation of ANSI color escapes for Windows'''

import IPython
import readline

out = readline.GetOutputFile()
IPython.genutils.Term.out = out
IPython.genutils.Term.err = out
del out
del readline
del IPython

and this line in ipythonrc.ini

execfile enable_color.py

/end quote

If this fixes things, please let me know.  I could even add code to ipython to 
do this automatically: since the 'real' GNU readline does NOT have a 
GetOutputFile method,

In [2]: readline.GetOutputFile()
AttributeError: 'module' object has no attribute 'GetOutputFile'

it would be easy for me to enable auto-detection of this under Windows.  What 
I'm not too sure how to handle is cygwin: I suppose I should only do this for 
non-cygwin environments.  Is there a way under Windows to distinguish between 
python running under cygwin and under the normal environment?

Anyway, if the above is not enough, perhaps you could try Gary's CVS readline 
code.  It's possible that his CVS code is needed for this to work, I'm not sure.

Please let me know how this progresses, hopefully we can converge on a clean 
solution for Windows

>>The Readline functionality seems to work (tab completion, 
>>movement/edits). Except Ctl-U, which doesn't do anything. Shouldn't it 
>>erase the line? (Ctl-W deletes words as expected.)

I suppose it's possible that C-u is just not implemented (I didn't even knew 
it existed til you mentioned it :)

> Just a short "me too" (in a way). I am solely using Python/IPython on
> Linux and Cygwin and have tried it now for the first time on native
> Windows using ctags, Bishop's readline and rlcompleter2.
> Issues:

> * Typing is incredibly slow with readline (about half a second delay
> between each character)

Mmmh.  I hadn't heard of this one before.  Any Windows user with an idea about 
what may be causing this?

> * The history is saved in native Windows format showing ^Ms at the end
> when one uses a shared Cygwin and Windows history file (this is not
> unique to IPython and shows in vanilla Python shell, too)

Given that this is a fundamental problem of the Windows '\r\n' EOL convention, 
I don't see an easy way to work around it, sorry.

> * regarding your "less" problem, you might consider "rebasing" your
> Cygwin installation.

Thanks for the suggestion.

I hope we can eventually iron these problems out.  Thanks for the help in 
testing and debug-by-proxy.



More information about the IPython-user mailing list