On a whim, I added support for the 256 color xterm-specific escape sequences. Although I did not fully re-implement XParseColor, I covered the more important cases.
This means that the output formatting that works in the common GUI terminal emulators is now supported by the Qt console. For example, Nicolas Rougier's ASCII imshow now works:
This is cool.
I think what we really want, with the new two-process model, is to remove hard-coded xterm coloring entirely from the backend, and send css-style scoped fields to the frontends, which can render colors in an appropriate manner to their output.
I agree with Min for the long-term view, but I also think it's very valuable to have the frontend recognize cleanly all xterm escapes, since any script the user runs can spit these out (like Nicolas').
The code looks great to me, and I tested it both with pyqt and pyside, and both work.
Merge away, and thanks again for the great work!
Added 256-color support to Qt console escape sequence processing.