src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java
changeset 53215 299fe76c25c7
parent 52938 5ff7480c9e28
child 53280 f152abfd2751
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Tue Jan 08 09:29:36 2019 +0100
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java	Tue Jan 08 16:31:27 2019 +0100
@@ -59,6 +59,7 @@
 import jdk.internal.org.jline.keymap.KeyMap;
 import jdk.internal.org.jline.reader.Binding;
 import jdk.internal.org.jline.reader.EOFError;
+import jdk.internal.org.jline.reader.EndOfFileException;
 import jdk.internal.org.jline.reader.History;
 import jdk.internal.org.jline.reader.LineReader;
 import jdk.internal.org.jline.reader.LineReader.Option;
@@ -200,6 +201,8 @@
             return in.readLine(firstLinePrompt);
         } catch (UserInterruptException ex) {
             throw (InputInterruptedException) new InputInterruptedException().initCause(ex);
+        } catch (EndOfFileException ex) {
+            return null;
         }
     }
 
@@ -1212,6 +1215,7 @@
                     while ((r = input.read()) != (-1)) {
                         processInputByte(r);
                     }
+                    slaveInput.close();
                 } catch (IOException ex) {
                     throw new IllegalStateException(ex);
                 }