Mouse support. Fix & verify Webassembly support.

There was some undefined behavior to be fixed in the terminal input
parser.

The behavior of flush seems to have change. The fix was to invert '\0'
and std::flush.
This commit is contained in:
ArthurSonzogni
2021-04-25 16:58:16 +02:00
parent 0b9b6c692a
commit a27c878a3f
6 changed files with 55 additions and 19 deletions

View File

@@ -40,7 +40,7 @@ namespace {
void Flush() {
// Emscripten doesn't implement flush. We interpret zero as flush.
std::cout << std::flush << (char)0;
std::cout << '\0' << std::flush;
}
constexpr int timeout_milliseconds = 20;
@@ -353,6 +353,8 @@ void ScreenInteractive::Loop(Component* component) {
DECMode::kMouseSgrExtMode,
});
flush();
auto event_listener =
std::thread(&EventListener, &quit_, event_receiver_->MakeSender());