Screen that dumps raw bytes for terminal #681
-
I've written a TUI that displays structured tabular data. I now need a one-shot rendering opportunity to dump this output anywhere, e.g., to stdout, stderr, file, etc. Where the raw bytes go that make up rendered output is opaque in my API. I can literally just pass bytes downstream. So what I am looking for is a function that gives me a byte sequence that represents my rendered screen. I would like to offer two options: colored and monochrome. I am not sure where FTXUI internals produce this raw byte sequence before it hits the TTY, but that's where I would hope to get a chance to interpose—optionally enable/disable coloring. What's the best way to make this happen? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
My hope was that |
Beta Was this translation helpful? Give feedback.
-
Hello @mavam, I think you are describing this function: std::string ToString(Component& component) {
auto document = component->render();
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
Render(screen, document);
return screen.ToString();
} |
Beta Was this translation helpful? Give feedback.
Hello @mavam, I think you are describing this function: