[PyPy-issue] [issue664] [PATCH] Extend readline emulation to support colour code and ansi escapes

Martijn pypy-dev-issue at codespeak.net
Tue Mar 8 23:52:07 CET 2011


New submission from Martijn <ss at kleptog.org>:

Currently IPython breaks on terminal input because it uses readline features not
in PyPy, namely:

- Use of \x01 and \x02 to bracket ANSI escape codes to exclude them from length
calculations.
- Use of newlines in prompts.
- ANSI codes weren't handled in unix_console.

For the first there's a new function to calculate the length of the prompt. For
the second the prompt is split on newlines and output separately, which produces
the desired effect. For the last I added a bit of code that, if ANSI codes were
used, moves the cursor to a known position.

----------
effort: ???
files: readline-prompt.patch
messages: 2276
nosy: kleptog, pypy-issue
priority: feature
release: ???
status: unread
title: [PATCH] Extend readline emulation to support colour code and ansi escapes

_______________________________________________________
PyPy development tracker <pypy-dev-issue at codespeak.net>
<https://codespeak.net/issue/pypy-dev/issue664>
_______________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readline-prompt.patch
Type: text/x-patch
Size: 2892 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-issue/attachments/20110308/f9a8e686/attachment.bin>


More information about the Pypy-issue mailing list