This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch mvnd-1.x
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git

commit 0c7a117345490a29e474a6cf0fe6bcf932402042
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sun Nov 15 11:50:38 2026 +0100

    Do not report a stdin read timeout as end of input
    
    A timed read returns READ_EXPIRED when no input arrived in time. Sending EOF
    for it closed System.in in the daemon for the rest of the build.
---
 .../mvndaemon/mvnd/common/logging/TerminalInputHandler.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git 
a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalInputHandler.java
 
b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalInputHandler.java
index b80ea345..f5503a29 100644
--- 
a/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalInputHandler.java
+++ 
b/common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalInputHandler.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.function.Consumer;
 
 import org.jline.terminal.Terminal;
+import org.jline.utils.NonBlockingReader;
 import org.mvndaemon.mvnd.common.Message;
 
 /**
@@ -149,6 +150,16 @@ public class TerminalInputHandler implements AutoCloseable 
{
 
         while ((bytesToRead < 0 || idx < bytesToRead) && idx < buf.length) {
             int c = terminal.reader().read(timeout);
+            if (c == NonBlockingReader.READ_EXPIRED) {
+                // No input within the timeout: this is not the end of the 
stream
+                if (idx > 0) {
+                    break;
+                }
+                if (closing) {
+                    return;
+                }
+                continue;
+            }
             if (c < 0) {
                 // End of stream reached
                 if (idx > 0) {

Reply via email to