moves the cursor relative to its current location
function moveCursor(stream, dx, dy) {
  if (stream === null || stream === undefined)
    return;

  if (dx < 0) {
    stream.write(CSI`${-dx}D`);
  } else if (dx > 0) {
    stream.write(CSI`${dx}C`);
  }

  if (dy < 0) {
    stream.write(CSI`${-dy}A`);
  } else if (dy > 0) {
    stream.write(CSI`${dy}B`);
  }
}