Questions tagged [jline]

JLine is a Java library for handling console input. It is similar in functionality to BSD editline and GNU readline. People familiar with the readline/editline capabilities for modern shells (such as bash and tcsh) will find most of the command editing features of JLine to be familiar.

JLine is a Java library for handling console input. It is similar in functionality to BSD editline and GNU readline. People familiar with the readline/editline capabilities for modern shells (such as bash and tcsh) will find most of the command editing features of JLine to be familiar.

JLine 2.x is an evolution of JLine 1.x which was previously maintained at SourceForge.

Features

JLine sports the following major features:

  1. Command history - Lines that have been previously entered may be recalled and edited and can be persisted so that they are available across sessions of your program.

  2. Line editing - JLine allows full editing of the current command line and attempts to mimic as much of the behavior of GNU Readline as possible, including support for both emacs and vi key mappings.

  3. Completion - JLine provides a pluggable mechanism for implementing command line tab completion (of course completion can be bound to any key you wish).

  4. Custom Key bindings - Keys may be arbitrarily remapped to perform a specific action, and JLine attempts to honor any mapping that is set in your existing readline .inputrc file.

  5. Character Masking - Input may be gathered from the user without any visual feedback. This is useful for prompting for passwords.

  6. 99.99% Java - The vast portion of JLine is all Java, using only some small bit of native code, provided by the Jansi project, to support Windows.

89 questions
1
vote
0 answers

How to tell Java to use jline3

Scala newbie and following this blog to use sbt (I have a little Java experience using Eclipse). sbt is working, however I must have the ncurses issue described here. Instead of downgrading ncurses I'm trying to upgrade jline. I cloned the new…
wbg
  • 866
  • 3
  • 14
  • 34
1
vote
1 answer

Detect Ctrl and Alt keys at a Java console

I'm currently using JLine (http://jline.sourceforge.net/) to read characters from the console in Java one at a time. Terminal terminal = TerminalFactory.getFlavor(TerminalFactory.Flavor.WINDOWS); terminal.init(); terminal.setEchoEnabled(false); int…
Femi
  • 64,273
  • 8
  • 118
  • 148
1
vote
3 answers

jline multi-argument parsing

I am trying to get JLine to do tab completion so I can enter something like the following: commandname --arg1 value1 --arg2 value2 I am using the following code: final List completors = Arrays.asList( new SimpleCompletor("commandname…
Paul McKenzie
  • 19,646
  • 25
  • 76
  • 120
1
vote
1 answer

Java Console Application with jLine

I have a multi thread java console application. One of the threads is reading input from the user while other prints to the console some data. The problem shows up when the writer thread print something while user is typing an input. It interrupts…
Bünyamin Sarıgül
  • 3,031
  • 4
  • 30
  • 55
1
vote
1 answer

JLine 3 - Keep the prompt always at the bottom

I want the prompt to display at the bottom of the page every time. I have a GIF of that: The prompt not displaying properly The code is that for read line: @Override public void run() { while (((ElytraServer) ElytraAPI.getServer()).isRunning()) …
1
vote
0 answers

Readline support when running programs in Eclipse

I've just started using JLine for console input in my programs. In a bash shell, this works great. In the Eclipse Console view, nothing useful works - no history, no command completion. Is there a way to get this working? (I'm on OSX in case that's…
mo-seph
  • 6,073
  • 9
  • 34
  • 35
1
vote
0 answers

JLine2: Is it a bug in completion mechanism or not?

Here is my Java code. public class CompletionTest { public static void main(String[] args) throws IOException { ConsoleReader console = new ConsoleReader(); Completer nil = new NullCompleter(); Completer read = new…
barbara
  • 3,111
  • 6
  • 30
  • 58
1
vote
0 answers

JLine2: Got NPE when invoking ArgumentDelimiter

Here is my code. ConsoleReader console = new ConsoleReader(); Completer quit = new StringsCompleter("quit"); Completer subcommands = new ArgumentCompleter(new StringsCompleter("with-number"), new StringsCompleter("with-string")); Completer…
Alex
  • 2,091
  • 6
  • 31
  • 49
1
vote
1 answer

How to add values to key and save autocompletion with JLine?

I'm trying to implement a simple shell application with autocompletion. I use JLine library for it. Don't know maybe it's a common issue, but when I try to add some value to the parameter my autocompletion doesn't work. Here is my code…
Alex
  • 2,091
  • 6
  • 31
  • 49
1
vote
2 answers

Java console autocompletion with JLine

I try to write a simple Shell with autocompletion. I use JLine library. Here is my code. public class ConsoleDemo { public static void main(String[] args) { try { ConsoleReader console = new ConsoleReader(); …
Alex
  • 2,091
  • 6
  • 31
  • 49
1
vote
0 answers

Remove Action Listner from a jline ConsoleReader

I am using the jline.ConsoleReader provided and adding an ActionListner for a key (say pressing 'q') using q. addTriggerAction('q', new ActionListener(){ System.out.println("Triggered"); }); However after a certain time I need to stop triggering…
Sach
  • 845
  • 3
  • 9
  • 22
1
vote
1 answer

Why is the exception "IllegalArgumentException: Missing closing quote on line '"'"

When I run sbt from my unix prompt, I get the following after every command inside the console. [WARN] Unable to parse user configuration: java.lang.IllegalArgumentException: Missing closing quote on line '"' at…
0fnt
  • 8,211
  • 9
  • 45
  • 62
1
vote
1 answer

how to test a jline based console application

I'm trying to test a console application that uses jline for handling interaction with the user. I'm starting the application using ProcessBuilder which gives me access to the application's: Standard Input Standard Output Standard Error I was…
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
1
vote
1 answer

Place input while printing output with java jline

How can i place input text at the same time text is also being printed out without it effecting what i have placed? I'm trying to make a server where there is constant debugging information being printed, but at the same time i want to be able to…
1
vote
1 answer

Reference to JLine examples

I've been trying to write a Java console program that can act upon arrow keys. I came across JLine library that claims to be able to do this. I've tried a few times to use the JLine library to accomplish my goal, but have been unsuccessful in doing…
Guru Prasad
  • 4,053
  • 2
  • 25
  • 43