From efdf83a1edbe0521e8b94a39f06b4d7474c44def Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Fri, 3 Nov 2023 14:27:40 +0000 Subject: [PATCH] Upgrade jline 3.24.1 - Disable jni terminal provider in test ShellAutoConfiguration like it's done for jna/jansi - Default TerminalBuilder system outpu to SysOut to restore writing to stdout instead of stderr when redirect exists - Relates #891 - Relates #901 --- gradle.properties | 2 +- .../shell/boot/JLineShellAutoConfiguration.java | 2 ++ .../shell/test/autoconfigure/ShellAutoConfiguration.java | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 40e2dd33d..5c32d96cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ version=3.2.0-SNAPSHOT springBootVersion=3.2.0-RC1 nativeBuildToolsVersion=0.9.19 commonsIoVersion=2.11.0 -jlineVersion=3.23.0 +jlineVersion=3.24.1 st4Version=4.3.3 jimfsVersion=1.2 gradleEnterpriseVersion=3.10.3 diff --git a/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java index c9789f1ee..0ddeeb178 100644 --- a/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java +++ b/spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/JLineShellAutoConfiguration.java @@ -21,6 +21,7 @@ import org.jline.reader.Parser; import org.jline.terminal.Terminal; import org.jline.terminal.TerminalBuilder; +import org.jline.terminal.TerminalBuilder.SystemOutput; import org.jline.utils.AttributedString; import org.jline.utils.AttributedStyle; @@ -45,6 +46,7 @@ public class JLineShellAutoConfiguration { public Terminal terminal(ObjectProvider customizers) { try { TerminalBuilder builder = TerminalBuilder.builder(); + builder.systemOutput(SystemOutput.SysOut); customizers.orderedStream().forEach(customizer -> customizer.customize(builder)); return builder.build(); } diff --git a/spring-shell-test-autoconfigure/src/main/java/org/springframework/shell/test/autoconfigure/ShellAutoConfiguration.java b/spring-shell-test-autoconfigure/src/main/java/org/springframework/shell/test/autoconfigure/ShellAutoConfiguration.java index ddc694970..f01bd8e91 100644 --- a/spring-shell-test-autoconfigure/src/main/java/org/springframework/shell/test/autoconfigure/ShellAutoConfiguration.java +++ b/spring-shell-test-autoconfigure/src/main/java/org/springframework/shell/test/autoconfigure/ShellAutoConfiguration.java @@ -42,7 +42,8 @@ TerminalCustomizer terminalStreamsTerminalCustomizer(TerminalStreams terminalStr return builder -> { builder.streams(terminalStreams.input, terminalStreams.output) .jansi(false) - .jna(false); + .jna(false) + .jni(false); }; }