[IPython-user] NTEmacs + ipython: almost completely functional!!

Mike Krell spamaccount10000 at yahoo.com
Sun Apr 24 16:27:53 CDT 2005

I did some more digging and have gotten past the two
major issues I had with IPython under NTEmacs:

1.  Extraneous ^A and ^B characters in prompt -- a
similar problem was reported with running bash under
emacs a while back.  See:


The result was that a bug report was submitted for
bash.     A workaround is to add a hook so that emacs
will filter out the garbage characters.  I adapted it
for comint mode (replaced 'shell-mode-hook with
'comint-mode-hook) and it works fine.

2.  No output from python --  I did some debugging in
console.py (part of the readline implementation).  It
turned out that all the console API calls being made
on the standard output handle were failing with an
error code of 6 (invalid handle) even though the
handle value itself looked valid.  The online docs for
WriteConsole say that it will fail if used on a
standard handle which has been redirected to a file,
and suggests using WriteFile instead.  Sure enough, I
changed the lines in write_color and write_plain to
call WriteFile, and I now get output and error
messages like I expect.  One limitation is that the
SetConsoleTextAttribute call is still failing.  This
means colorized output does not work, but at least
IPython is usable in this state.


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the IPython-user mailing list