mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Stop using Sender/Receiver in TerminalInputParser. (#1073)
Stop using Sender/Receiver in TerminalInputParser. This will help removing usage of thread. At some point, my goal is to have an initialization step when installing the ScreenInteractive so that we can provide the terminal ID synchronously without losing some events. This will help with: https://github.com/ArthurSonzogni/FTXUI/pull/1069
This commit is contained in:
@@ -27,9 +27,9 @@ namespace {
|
||||
// Capture the standard output (stdout) to a string.
|
||||
class StdCapture {
|
||||
public:
|
||||
explicit StdCapture(std::string* captured)
|
||||
: captured_(captured) {
|
||||
if (pipe(pipefd_) != 0) return;
|
||||
explicit StdCapture(std::string* captured) : captured_(captured) {
|
||||
if (pipe(pipefd_) != 0)
|
||||
return;
|
||||
old_stdout_ = dup(fileno(stdout));
|
||||
fflush(stdout);
|
||||
dup2(pipefd_[1], fileno(stdout));
|
||||
@@ -188,9 +188,7 @@ TEST(ScreenInteractive, FixedSizeInitialFrame) {
|
||||
auto capture = StdCapture(&output);
|
||||
|
||||
auto screen = ScreenInteractive::FixedSize(2, 2);
|
||||
auto component = Renderer([&] {
|
||||
return text("AB");
|
||||
});
|
||||
auto component = Renderer([&] { return text("AB"); });
|
||||
|
||||
Loop loop(&screen, component);
|
||||
loop.RunOnce();
|
||||
@@ -241,7 +239,6 @@ TEST(ScreenInteractive, FixedSizeInitialFrame) {
|
||||
"\r\n"sv;
|
||||
ASSERT_EQ(expected, output);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
Reference in New Issue
Block a user