anchor.diff:  void printUsage(String argv0) {
     stdout.write('usage: $argv0 [option]... [--] (FILE|-)...\n\n'
                  '(- indicates standard input)\n');
  +}
  +
  +void printTerminal(Terminal terminal) {
  +  var out = new Map();
  +
  +  out['size'] = [terminal.height, terminal.width];
  +
  +  out['characters'] = [];
  +  for (var i = 0; i < terminal.height; i++) {
  +    var codes = new List<int>.from(
  +        terminal.lines[terminal.lines.length - terminal.height + i].characters);
  +    for (var j = 0; j < codes.length; j++) {
  +      if (codes[j] == 0) {
  +        codes[j] = 32;
  +      }
  +    }
  +    out['characters'].add(new String.fromCharCodes(codes));
  +  }
  +
  +  out['position'] = [terminal.cursorY, terminal.cursorX];
  +
  +  stdout.write(const JsonEncoder.withIndent('  ').convert(out));
  +  stdout.write('\n');
   }
   
   void main(List<String> arguments) {
  
positive.code: // prints out the rendered characters (ignoring colors and attributes).
  // This is probably most useful when stdin/stdout are redirected from/to files.
  
  import 'dart:core';
  import 'dart:io';
  
  
negative.code:     }
    }
  
    printTerminal(terminal);
  }
  