jamesfredley commented on PR #15367: URL: https://github.com/apache/grails-core/pull/15367#issuecomment-4255311974
## Changes addressing review comments Merged latest `8.0.x` into the branch (resolved conflict in `dependencies.gradle` - took JLine 3 / Jansi 2 versions from this PR, picked up newer javaparser 3.28.0, jna 5.18.1, and spring-boot-loader-tools from base). ### Fixes for jdaugherty's review (#4087092200) **1. CandidateListCompletionHandler.java - Remove direct buffer manipulation** Removed `reader.getBuffer().write(suffix)` and `reader.callWidget(LineReader.REDRAW_LINE)` from `complete()`. In JLine 3, the `LineReader` handles buffer updates and display after completers populate candidates. The `complete()` method now only delegates to the wrapped completer, letting JLine's built-in completion machinery handle common-prefix insertion and redraw. **2. GrailsConsole.java - Restore `grails.console.enable.terminal=false` check** Restored the `isActivateTerminal()` conditional inside the interactive path. The previous code unconditionally called `createTerminal()` when interactive mode was enabled, which meant `grails.console.enable.terminal=false` was no longer honored. Now the terminal is only created when both interactive mode AND terminal activation are enabled, matching the original `8.0.x` behavior for headless/embedded environments. **3. GrailsCli.groovy - Restore Esc key cancellation** Added `KEYPRESS_ESC` constant and non-blocking read on the terminal's input stream during command execution. The old code handled both Ctrl+C (`KEYPRESS_CTRL_C`) and Esc (`KEYPRESS_ESC`) for cancellation, but the JLine 3 migration only wired up `Terminal.Signal.INT` for Ctrl+C. Now both cancellation paths work: Ctrl+C via JLine 3's signal handler, and Esc via polling the terminal input stream. **4. GrailsCli.groovy - Fix `!` history replay regression** Rewrote `bang()` to iterate backwards through history looking for the first non-`!` entry, rather than unconditionally skipping one entry. The previous code assumed JLine 3 had already persisted the `!` command to history and blindly called `historyIterator.next()` to skip it. If JLine 3 hadn't added `!` yet, this would replay the wrong command. The new approach is robust regardless of history persistence timing. **5. SbomPlugin.groovy - Remove stale JLine 3.23.0 license mapping** Removed the `org.jline/[email protected]` license mapping entry. Only the current version (`3.30.6`) needs a mapping. There's no reason to have two different 3.x versions in the map. -- 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]
