diff --git a/picocli-shell-jline2/README.md b/picocli-shell-jline2/README.md index 89d4cd2b0..c9c1c1819 100644 --- a/picocli-shell-jline2/README.md +++ b/picocli-shell-jline2/README.md @@ -71,7 +71,7 @@ public class Example { * Top-level command that just prints help. */ @Command(name = "", description = "Example interactive shell with completion", - footer = {"", "Press Ctrl-D to exit."}, + footer = {"", "Press Ctrl-C to exit."}, subcommands = {MyCommand.class, ClearScreen.class, ReadInteractive.class}) static class CliCommands implements Runnable { final ConsoleReader reader; @@ -155,6 +155,16 @@ public class Example { } public static void main(String[] args) { + + // JLine 2 does not detect some terminal as not ANSI compatible (e.g Eclipse Console) + // See : https://github.com/jline/jline2/issues/185 + // This is an optional workaround which allow to use picocli heuristic instead : + if (!Help.Ansi.AUTO.enabled() && // + Configuration.getString(TerminalFactory.JLINE_TERMINAL, TerminalFactory.AUTO).toLowerCase() + .equals(TerminalFactory.AUTO)) { + TerminalFactory.configure(Type.NONE); + } + try { ConsoleReader reader = new ConsoleReader(); IFactory factory = new CustomFactory(new InteractiveParameterConsumer(reader)); @@ -255,4 +265,4 @@ public class CustomFactory implements IFactory { } } -``` \ No newline at end of file +```