Closed vnepogodin closed 2 years ago
Yes kind of...
I would do:
auto screen = ScreenInteractive::Fullscreen()
auto exit_loop = screen.ExitClosure(); // Movable and thread safe function.
auto component = CreateMyComponent(exit_loop);
while(true) {
screen.Loop(component);
execute_bash_interactively()
}
And someone somewhere call:
exit_loop();
Alternatively, it could be possible to expose and call: https://github.com/ArthurSonzogni/FTXUI/blob/84299de2e11522ad1d531a50f7610678ae0e5e67/include/ftxui/component/screen_interactive.hpp#L35-L36 while inside the loop, but I am not sure without giving it more thoughts.
Thanks! I'll expose those functions. And try if it helps.
exit_loop
will not help me as I spawn component from another component and if I execute execute_bash_interactively
it will just ignore it
@ArthurSonzogn, thanks again! It worked. Should I create PR with example?
Great! Yes, you can submit a PR. I will have to work a bit on top of your change if I want to merge it. I will add example.
Great! Yes, you can submit a PR. I will have to work a bit on top of your change if I want to merge it. I will add example.
Ok I did submit a PR with example.
Is it possible to " suspend" FTXUI component from writting to stdout. And " resume" after child process is done.
For example: I want to execute
bash
interactively(so I need to block FTXUI from writting to the input stream), and afterexit
, unlock FTXUI