mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 11:01:08 +02:00
Fix canonical input for network client
It is valid for the thin client input stream to return -1 as an EOF when the user inputs ctrl+d in canonical mode.
This commit is contained in:
@@ -934,12 +934,9 @@ class NetworkClient(
|
||||
val stopped = new AtomicBoolean(false)
|
||||
override final def run(): Unit = {
|
||||
def read(): Unit = {
|
||||
inputStream.read match {
|
||||
case -1 =>
|
||||
case b =>
|
||||
inLock.synchronized(stdinBytes.offer(b))
|
||||
if (attached.get()) drain()
|
||||
}
|
||||
val b = inputStream.read
|
||||
inLock.synchronized(stdinBytes.offer(b))
|
||||
if (attached.get()) drain()
|
||||
}
|
||||
try read()
|
||||
catch { case _: InterruptedException | NonFatal(_) => stopped.set(true) } finally {
|
||||
|
||||
Reference in New Issue
Block a user