granite icon indicating copy to clipboard operation
granite copied to clipboard

Widgets: Add TerminalView

Open wpkelso opened this issue 8 months ago • 2 comments

image image

Introduces a TerminalView widget that

  • Automatically includes terminal styling from #864 , which is now an internal style class
  • Includes toggleable autoscroll functionality
  • Uses a scrollable TextView

Also:

  • Switches message dialog to use this new widget
  • Moves Terminal View to it's own page in the demo app

Future extensions

  • Include option to automatically tie to stdout or stderr
  • Support ANSI graphics and color escape codes

wpkelso avatar May 14 '25 16:05 wpkelso

If it's possible with this widget, maybe it would be worth to show colour palette?

Small snippets on how to archive those colours. e.g. for [PASS], [FAIL], [WARNING].

stsdc avatar Jun 11 '25 11:06 stsdc

If it's possible with this widget, maybe it would be worth to show colour palette?

Supporting ANSI Graphics/Color escape codes would be useful. However, I don't know whether it would be better to delay this PR to add that support, or to include that support in a follow-up.

—Edit: Thinking further on it, this is probably better in a follow-up. At minimum (thinking out loud), I expect this would require a fully defined TextTagTable, some reworking of the stylesheet to allow us to actually apply foreground colors, and some mechanism to apply the tags.

wpkelso avatar Jun 11 '25 15:06 wpkelso