FTXUI icon indicating copy to clipboard operation
FTXUI copied to clipboard

How ftxui directly displays terminal results

Open Kurama622 opened this issue 2 years ago • 3 comments

I want to implement a preview feature like the ranger and fzf.

I think the best way is to directly call third-party tools such as bat or ccat to return the terminal result directly in the subwindow, but I don't know how ftxui directly displays the terminal result, I can only get the terminal result as a string, and then add the color.

I want a preview effect

Kurama622 avatar Jan 23 '23 16:01 Kurama622

FTXUI doesn't support parsing terminal output, it only "produce" terminal output. That's the second time someone ask for it. It might worth implementing.

ArthurSonzogni avatar Feb 03 '23 17:02 ArthurSonzogni

dear ArthurSonzogni, I have made some new progress now, I pretended to be a tty to obtain the shell output with color, ftxui just needs to be displayed like a terminal, but I got the following situation. Is this because of what you said about ftxui Can't parse terminal output? ( Unable to parse color information([38;5;238m) from terminal output? ) image

Kurama622 avatar Mar 25 '23 12:03 Kurama622

Yes, we would have to create a function:

element terminalOutput(std::string)

that would parse the content of the line and emit some ftxui element.

ArthurSonzogni avatar Jun 01 '23 07:06 ArthurSonzogni