PankuConsole icon indicating copy to clipboard operation
PankuConsole copied to clipboard

Support print_rich()

Open qwitwa opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. I want to see rich text output, but instead I see terminal escape codes

Describe the solution you'd like Rich text output displays in panku as in the terminal output

Example of terminal output using print_rich: image

How it appears inside of panku: image

qwitwa avatar Oct 09 '23 12:10 qwitwa

This appears to be a highly desired feature within our community.

At present, Panku directly accesses the output file produced by the Godot engine to retrieve all text passed to native Godot log functions like print, print_rich, push_error, etc. (really primitive, since godot does not provide proper logging utilities for external tools). This text is then displayed using a BBCode text component.

When print_rich outputs to standard output, it converts a supported subset of BBCode to ANSI escape codes, which the terminal emulator then displays.

To accurately capture the original BBCode string passed to print_rich, we need to create a wrapper function, such as panku_print_rich, to intercept the BBCode.

In summary, we should introduce a new log API to the Panku singleton to properly manage rich output.

This represents an excellent opportunity for contribution. I strongly encourage you to develop this feature and submit a pull request!

Ark2000 avatar Oct 11 '23 06:10 Ark2000

Yeah, I'm also experiencing this issue. I use BBcode to color my own logger's output, then it's ingested by Panku and it prints the ANSI codes (it applies the colors too): image

unfa avatar Jul 07 '24 13:07 unfa