#38 exit if there was an error writing to the socket
authorKevin Lamonte <Kevin.Lamonte@honeywell.com>
Thu, 28 Feb 2019 21:58:44 +0000 (15:58 -0600)
committerKevin Lamonte <Kevin.Lamonte@honeywell.com>
Thu, 28 Feb 2019 21:58:44 +0000 (15:58 -0600)
src/jexer/backend/ECMA48Terminal.java

index f0b3e3cc20d7d936368a528b75062a77db087114..92758ee6a65e096072af59d53c5bca973f8469c0 100644 (file)
@@ -1455,6 +1455,11 @@ public class ECMA48Terminal extends LogicalScreen
                         events.clear();
                     }
 
+                    if (output.checkError()) {
+                        // This is EOF.
+                        done = true;
+                    }
+
                     // Wait 20 millis for more data
                     Thread.sleep(20);
                 }
@@ -1466,7 +1471,11 @@ public class ECMA48Terminal extends LogicalScreen
                 done = true;
             }
         } // while ((done == false) && (stopReaderThread == false))
-        // System.err.println("*** run() exiting..."); System.err.flush();
+
+        // TODO: pass an event up to TApplication to tell it this Backend is
+        // done.
+
+        System.err.println("*** run() exiting..."); System.err.flush();
     }
 
     // ------------------------------------------------------------------------