From eb0d6c82905932e04acfb4066ab680ef867931ce Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Thu, 28 Feb 2019 15:58:44 -0600 Subject: [PATCH] #38 exit if there was an error writing to the socket --- src/jexer/backend/ECMA48Terminal.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/jexer/backend/ECMA48Terminal.java b/src/jexer/backend/ECMA48Terminal.java index f0b3e3c..92758ee 100644 --- a/src/jexer/backend/ECMA48Terminal.java +++ b/src/jexer/backend/ECMA48Terminal.java @@ -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(); } // ------------------------------------------------------------------------ -- 2.27.0