Skip to content

Commit

Permalink
Propagate JLine ENABLED better
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke committed Aug 23, 2024
1 parent 06cb20d commit fa9e6e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
public interface JLineProperties {
Property<Boolean> ENABLED = PropertyTypes.bool("hmc.jline.enabled");
Property<Boolean> PROPAGATE_ENABLED = PropertyTypes.bool("hmc.jline.propagate.enabled");

Property<String> PROVIDERS = PropertyTypes.string("hmc.jline.providers");
Property<String> READ_PREFIX = PropertyTypes.string("hmc.jline.read.prefix");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public List<String> build() throws LaunchException, AuthException {
}

CommandLineReader commandLineReader = launcher.getCommandLine().getCommandLineReader();
if (runtime && commandLineReader instanceof JLineCommandLineReader && ((JLineCommandLineReader) commandLineReader).isDumb()) {
if (runtime && commandLineReader instanceof JLineCommandLineReader && ((JLineCommandLineReader) commandLineReader).isDumb()
|| config.get(JLineProperties.PROPAGATE_ENABLED, true) && !config.get(JLineProperties.ENABLED, true)) {
result.add(SystemPropertyHelper.toSystemProperty(JLineProperties.ENABLED.getName(), "false"));
}

Expand Down

0 comments on commit fa9e6e3

Please sign in to comment.