Replacement for deprecated get_text() with attributes!=null
Hi, I have a particular use case for VTE for generating "frames" of text and formatting data that I can then render with a separate program. I want to extract the data once it's been parsed and the layout and attributes are determined.
Vte.Terminal.get_text() does almost exactly what I want. However, I see that the attribute argument is deprecated already. I found #2253 partly explains the rationale for the change.
Is there another [non-deprecated] way to extract all the information I would need from a VTE terminal instance to render the current page with a custom renderer? I see that I can copy html formatted text to the clipboard, and I could use that to extract all the information I need, but it feels wrong to pipe the data through the clipboard and potentially clobber what's there. I can't see a way to get the html output directly. Furthermore, vte still uses the attributes argument to get_text internally when generating html (via get_selected_text)
A further caveat: even if I use the existing deprecated api, I can't detect bold text. (related issues #1458 and #1992 ) And I guess that means currently bold doesn't work in html output? (edit: bold is not present in the deprecated VteCharAttributes, but is present in VteCellAttr, bold works in html, the html generator uses only the coordinates from the VteCharAttributes to lookup the character's VteCellAttr value)
If there is currently no plan here then my suggestion would be either:
- add a function to extract html data directly, instead of only being able to push it to the clipboard, or
- add a new function similar to get_text, which provides all the attributes via a stable api
(I would prefer to avoid dealing with html for my use case though)
Many thanks, Lex.