diff -r 9d60798b21af -r ff1c86e85d02 src/jdk.jshell/share/classes/jdk/internal/jshell/tool/StopDetectingInputStream.java --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/StopDetectingInputStream.java Wed Dec 12 23:08:01 2018 -0800 +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/StopDetectingInputStream.java Thu Dec 13 08:26:07 2018 +0100 @@ -113,7 +113,7 @@ } public synchronized void write(int b) { - if (state != State.BUFFER) { + if (state == State.READ) { state = State.WAIT; } int newEnd = (end + 1) % buffer.length;