Using CHANNEL_PRINTS to transfer printbuffers to stdout is now working.
This commit is contained in:
@@ -197,18 +197,18 @@ class Driver {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void handle_console_output() {
|
||||
while (true) {
|
||||
uint32_t ndata; const char *data;
|
||||
engw.get_outgoing(&engw, 0, &ndata, &data);
|
||||
if (ndata == 0) break;
|
||||
if (ndata > DRV_SHORTSTRING_SIZE) ndata = DRV_SHORTSTRING_SIZE;
|
||||
std::string_view src(data, ndata);
|
||||
int consumed;
|
||||
std::u32string cps = drvutil::utf8_to_utf32(src, &consumed);
|
||||
readline_device_.print(cps);
|
||||
engw.play_sent_outgoing(&engw, 0, consumed);
|
||||
if (engw.get_have_prints(&engw)) {
|
||||
uint32_t ndata;
|
||||
const char *data;
|
||||
engw.play_access(&engw, AccessKind::CHANNEL_PRINTS, 0, 0, "", &ndata, &data);
|
||||
if (ndata > 0) {
|
||||
if (ndata > DRV_SHORTSTRING_SIZE) ndata = DRV_SHORTSTRING_SIZE;
|
||||
std::string_view src(data, ndata);
|
||||
int consumed;
|
||||
std::u32string cps = drvutil::utf8_to_utf32(src, &consumed);
|
||||
readline_device_.print(cps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -660,8 +660,8 @@ class Driver {
|
||||
handle_new_outgoing_sockets();
|
||||
handle_socket_input_output();
|
||||
handle_console_input();
|
||||
handle_console_output();
|
||||
engw.play_update(&engw, drvutil::get_monotonic_clock());
|
||||
handle_console_output();
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
|
||||
Reference in New Issue
Block a user