Closed magro11 closed 6 months ago
ESC[2K and other erase sequences will now also be considered and removed. However, they are not interpreted.
Still open: If long lines are wrapped, the ANSI escape codes are not interpreted, if they are split at the line limit. --> TODO
From my perspective all issues are solved and this PR is ready to merge. @photoniker : what do you think?
I didn't see issues so far...
The console widget of itom can now handle ANSI escape sequences (see https://en.wikipedia.org/wiki/ANSI_escape_code), that can be used to format the output or error texts (e.g. text color, background color, bold, underline, italic...). This feature can also be disabled by a setting in the Console >> General tab of the itom property editor.
Python packages, like Sphinx or Numba, are using these codes per default. itom can now identify these codes, and if supported, change the style of the affected parts in the texts.
The pythonLogWidget, that can be used in user-defined GUIs for displaying Python output or error streams, can not interpret these ANSI escape sequences (or ANSI escape codes), however there is a new property removeAnsiEscapeSequences. If true, the special sequence codes are recognized and removed, but not interpreted. Nevertheless, this allows that the text is not messed up with these strange codes.
For examples, sett the demo itom/basics/demo_ansiEscapeSequencesOutput.py: