jamesfredley commented on code in PR #15367:
URL: https://github.com/apache/grails-core/pull/15367#discussion_r2748702083

##########
grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java:
##########
@@ -251,51 +241,64 @@ private boolean readPropOrTrue(String prop) {
         return property == null ? true : Boolean.valueOf(property);
     }
 
-    protected ConsoleReader createConsoleReader(InputStream systemIn) throws 
IOException {
-        // need to swap out the output to avoid logging during init
-        final PrintStream nullOutput = new PrintStream(new 
ByteArrayOutputStream());
-        final PrintStream originalOut = Log.getOutput();
-        try {
-            Log.setOutput(nullOutput);
-            ConsoleReader consoleReader = new ConsoleReader(systemIn, out);
-            consoleReader.setExpandEvents(false);
-            return consoleReader;
-        } finally {
-            Log.setOutput(originalOut);
+    protected LineReader createLineReader(Terminal terminal, History history) 
throws IOException {
+        LineReaderBuilder builder = LineReaderBuilder.builder()
+                .terminal(terminal)
+                .option(LineReader.Option.DISABLE_EVENT_EXPANSION, true);
+        if (history != null) {
+            builder.variable(LineReader.HISTORY_FILE, new 
File(System.getProperty("user.home"), HISTORYFILE).toPath());
+            builder.history(history);
         }
+        LineReader lineReader = builder.build();
+        if (history != null) {
+            history.attach(lineReader);
+            history.load();
+        }

Review Comment:
   Fixed in commit 2074cbfb95 - removed the redundant 
`history.attach(lineReader)` and `history.load()` calls. The LineReaderBuilder 
handles history setup when `.history(history)` is called.



-- 
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