code: function read() {
          return __awaiter(this, void 0, void 0, function* () {
              let retry = xvt.idleTimeout * (1000 / xvt.pollingMS) >> 0;
              let warn = retry >> 1;
              xvt.entry = '';
              xvt.terminator = null;
              try {
                  process.stdin.resume();
                  while (xvt.carrier && retry && xvt.validator.isEmpty(xvt.terminator)) {
                      if (xvt.typeahead)
                          process.stdin.emit('data', '');
                      else
                          yield wait(xvt.pollingMS);
                      if (xvt.idleTimeout > 0 && --retry == warn)
                          beep();
                      if (xvt.sessionAllowed > 0 && !(retry % xvt.pollingMS)) {
                          let elapsed = (new Date().getTime() - xvt.sessionStart.getTime()) / 1000;
                          if (elapsed > xvt.sessionAllowed)
                              xvt.carrier = false;
                      }
                  }
              }
              catch (err) {
                  xvt.carrier = false;
              }
              if (!xvt.carrier || !retry) {
                  //  any remaining cancel operations will take over, else bye-bye
                  if (cancel.length) {
                      rubout(input.length);
                      xvt.entry = cancel;
                      out(xvt.entry);
                  }
                  else {
                      if (!xvt.carrier) {
                          outln(xvt.off, ' ** ', xvt.bright, 'your session expired', xvt.off, ' ** ');
                          xvt.reason = 'got exhausted';
                      }
                      if (!retry) {
                          outln(xvt.off, ' ** ', xvt.faint, 'timeout', xvt.off, ' ** ');
                          xvt.reason = 'fallen asleep';
                      }
                      beep();
                      hangup();
                  }
                  //return new Promise(reject => 'timeout')
              }
              if (cancel.length && xvt.terminator === '\x1B') {
                  rubout(input.length);
                  xvt.entry = cancel;
                  out(xvt.entry);
              }
              //  sanity resets back to default stdin processing
              echo = true;
              eol = true;
              input = '';
          });
      }
docs: buffer constructed emulation output(s)