gnodet commented on code in PR #1944:
URL: https://github.com/apache/maven-mvnd/pull/1944#discussion_r4792853689


##########
common/src/main/java/org/mvndaemon/mvnd/common/logging/TerminalInputHandler.java:
##########
@@ -194,6 +202,9 @@ private void handlePrompt(Message.Prompt prompt) throws 
IOException {
             int c = terminal.reader().read();
             if (c < 0) {
                 break;
+            } else if (c == TerminalOutput.KEY_CTRL_C) {

Review Comment:
   **Good implementation**
   
   Correctly handles Ctrl+C during prompt input. The placement before the 
newline check ensures immediate cancellation without waiting for Enter to be 
pressed.
   
   One small suggestion: Consider the same defensive pattern for 
`daemonDispatch`:
   ```java
   } else if (c == TerminalOutput.KEY_CTRL_C) {
       Consumer<Message> dispatch = daemonDispatch;
       if (dispatch != null) {
           dispatch.accept(Message.BareMessage.CANCEL_BUILD_SINGLETON);
       }
       break;
   }
   ```
   
   _Claude Code on behalf of Guillaume Nodet_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to