epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.12k stars 69 forks source link

Seer console does not interpret ANSI escape codes #240

Closed culyun closed 2 months ago

culyun commented 3 months ago

I use ANSI escape sequences to colourise terminal output. These are interpreted correctly by pretty much every terminal out there.

The Seer console does not appear to understand these escape sequences.

Please provide the ability to interpret ANSI escape sequences.

epasveer commented 3 months ago

Thanks for trying Seer out.

A better console has been on my list for a long time. I've been looking for a light-weight terminal "widget" that can be easily included with Seer's code base without too many dependecies. This one looks promising.

https://github.com/lxqt/qtermwidget

Alternatively, another Seer use suggested an option to output text to the terminal that Seer was launched from. (Not always possible, through) https://github.com/epasveer/seer/issues/225 Not sure if that's enough for you.

epasveer commented 3 months ago

Just some references for myself.

https://forum.qt.io/topic/96638/qplaintextedit-vt100-espace-sequence-support https://github.com/qt-creator/qt-creator/blob/8c288bf05fa8b0df10778421f71f7406fc175bd3/src/libs/utils/ansiescapecodehandler.cpp

epasveer commented 3 months ago

Hi Steve,

Just want to confirm its for colorizing text. And not more advance ANSI codes like cursor positioning and screen clearing...

Thanks.

culyun commented 3 months ago

I only use ANSI colour codes, but use your judgment.

I recommend looking for a FOSS VT100 terminal widget for QT. Must be a few around.. I do not recommend writing it yourself :-)

The full set of escape sequences goes back to some Brotosaurus-B mainframe, and is of little value IMO. But I think a reasonable subset would be the goal. Some terminal GUI libraries push this quite hard..

epasveer commented 3 months ago

Thanks for the added info.

I might add simple color codes to my simple widget, for now, while I look for a QT terminal widget.

What I'm concerned is making the build process still simple/reliable if I add an external project for the terminal widget...

epasveer commented 3 months ago

Another link for myself:

https://stackoverflow.com/questions/26500429/qtextedit-and-colored-bash-like-output-emulation https://stackoverflow.com/questions/61760344/qtextedit-ansi-symbol

epasveer commented 2 months ago

Another link for myself:

https://xn--rpa.cc/irl/term.html https://espterm.github.io/docs/VT100%20escape%20codes.html https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm

epasveer commented 2 months ago

I've started this side project for a QAnsiTextEdit widget.

https://github.com/epasveer/QAnsiTextEdit

image

epasveer commented 2 months ago

Hi @culyun

I've updated Seer with my new QAnsiTextEdit widget.

image

If you want to try it, clone this branch and build it. Let me know of problems. There will likely be some.

$ git clone -b 240-seer-console-does-not-interpret-ansi-escape-codes https://github.com/epasveer/seer.git

Thanks.

epasveer commented 2 months ago

Merged into mainline. Let me know of problems. Closing task. Can be reopened if needed.