prompt-toolkit / ptpython

A better Python REPL
BSD 3-Clause "New" or "Revised" License
5.19k stars 277 forks source link

[feature] Can it support ANSI escape code? #505

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 2 years ago

Screenshot from 2022-08-22 19-00-08

Thanks.

Freed-Wu commented 1 year ago

It looks like the problem that plotext uses ansi escape code.

This is pydoc plotext.sin in shell and help(plotext.sin) in python:

screen-2023-01-13-19-49-54

python doesn't support ansi escape codes in docstring, even if pydoc and help().

@piccolomo

piccolomo commented 1 year ago

Interesting, would you like me to work on docstrings free from ansi codes for next version?

Freed-Wu commented 1 year ago

docstrings free from ansi codes for next version

I think it is an easy solution to help() or pydoc correctly :smile:

piccolomo commented 1 year ago

Cool, I would work on it (may take some time till I get back coding). Feel free to open an issue about it to get updated. Otherwise hopefully I remember to write here and update.

piccolomo commented 1 year ago

Hi @Freed-Wu,

Sorry for such long break.

The new version (only on GitHub for now) has also docstrings free from ansi codes.

The docstrings are explained here and the installing instructions are here.

All the best, Savino