Implement more sophisticated readline-mode

This commit is contained in:
2021-11-04 13:40:42 -04:00
parent cf5a2d7462
commit deaf4e4873
7 changed files with 150 additions and 64 deletions

View File

@@ -176,8 +176,9 @@ public:
void handle_console_output() {
int nbytes; const char *bytes;
driven_->drv_peek_outgoing(0, &nbytes, &bytes);
if (nbytes > 0) {
while (true) {
driven_->drv_peek_outgoing(0, &nbytes, &bytes);
if (nbytes == 0) break;
HANDLE hstdout = GetStdHandle(STD_OUTPUT_HANDLE);
assert(hstdout != INVALID_HANDLE_VALUE);
DWORD nwrote;