   #endif
 
   #if hasSerial
-    static char line[20];
+    static char line[20], next = 0, last;
     static byte lineIndex = 0;
-
     if (Serial.available()) {
-      byte next = Serial.read();
+      last = next;
+      char next = Serial.read();
+      sendEcho(next, last);
       if (lineIndex < sizeof line)
         line[lineIndex++] = next;
       if (next == '\r' || next == '\n') {

{
  #if hasSerial
    Serial.println(detectGigatron() ? ":Gigatron OK" : "!Gigatron offline");
    Serial.println("\nCmd?");
  #endif
}


  // Check that vSync and hSync characteristics look normal
  return 0.95 <= vSync && vSync <= 1.20 && 0.95 <= hSync && hSync <= 1.05;
}

#if hasSerial
void sendEcho(char next, char last)
{
  if (echo)
    switch (next) {
      case 127:  Serial.print("\b \b"); return;
      case '\n': if (last == '\r')      return; // else FALL THROUGH
      case '\r': Serial.println();      return;
      default: Serial.print(next);
    }
}
#endif

#if hasSerial
void doCommand(char line[])
