# Riding an I/O stream

We call "riding" the act of hooking the console, that is, "rtype" and "key",
to a specified I/O stream, then loop until "key" yields the CTRL+Q key.

The unit at [io/ride.fs] provides "ride ( stream -- )" which does that. This is
mostly for being used on a communication line.

## Example usage

needs drv/pc/com io/ride
com1 ride
\ Typed stuff goes over the wire, what comes from the wire goes on screen.

## API

### Values

autoLF (default 0)
  When nonzero, emits a LF whenever it receives a CR, after it.

### Words

ride ( stream -- )
  Repeatedly read stream for input. When there is, call "rtype" on it. In
  parallel poll "?key". When there's a key type, unless it's the Escape ($1b)
  key, write it to stream. If it's the Escape key, exit the loop.

  Both CR and LF are treated as newlines. CR followed by LF is treated as a
  single newline.

  Except for CR and LF, received control characters are displayed in hex in
  between <> brackets.
