Closed MCMDEV closed 4 years ago
I tried the Example and it's working perfectly smooth.
@MCMDEV, do you have jna/jansi jar in your classpath? By the way if you want that LineReader
uses your terminal
you should build reader
as
LineReader reader = LineReaderBuilder.builder()
.terminal(terminal)
.completer(new StringsCompleter("abc"))
.build();
I have observed the same effect when multiple Windows terminals are created -- it looks as though they end up competing to receive events, so it becomes random whether or not each keypress will reach the terminal you're actually using.
This would be triggered in this example because the LineReaderBuilder is creating a second terminal implicitly, as @mattirn observes.
Multiple system terminals are not supported. Your process only has one, so you should not try to create multiple system terminals with jline.
The TerminalBuilder
could throw an exception if a system terminal has been created and not closed while attempting to create another one.
I'm not sure if this is normal behaviour but the input in when using either JNA or Jansi are lagging and keypresses aren't registering properly.