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.

78 questions
11
votes
3 answers

how to cancel ConsoleReader.readLine()

first of all, i'm learning scala and new to the java world. I want to create a console and run this console as a service that you could start and stop. I was able to run a ConsoleReader into an Actor but i don't know how to stop properly the…
OXMO456
  • 3,558
  • 2
  • 23
  • 35
11
votes
2 answers

zookeeper client does not provide CLI with "jline support is disabled" message

I just brought up CDH 5.4 and installed zookeeper. I used zkCli successfully many times before. This time the command line launch stops before getting to the prompt with Welcome to ZooKeeper! JLine support is disabled 2015-05-04 18:18:33,936 [myid:]…
bhomass
  • 2,958
  • 5
  • 33
  • 64
8
votes
2 answers

Java keyboard input parsing in a console app

I've just started messing around with JLine to parse character input in console mode. It seems to work well, but I'm wondering: Is there a nonblocking way in JLine to find out if characters are available? (i.e. like kbhit() in Windows.) I suppose I…
Jason S
  • 171,795
  • 155
  • 551
  • 900
8
votes
1 answer

jline2 print "^J" when it should print "\n" on a telnet console

I am using JLine 2 (v2.13) in conjunction with a Socket IO to create an admin console for my app which can be accessed via an ordinary telnet client. However I found it prints out strange symbols when it should print out a line…
Gelin Luo
  • 13,399
  • 23
  • 77
  • 119
8
votes
1 answer

Debug Jline2 application via Eclipse

I am using Jline2 framework to build a console application in Java. When launching the application from Eclipse on Windows 7, the shell exists immediately and does not wait for the user to input commands. Any idea on what might be wrong?
sangupta
  • 2,336
  • 3
  • 22
  • 36
6
votes
2 answers

Clojure standard REPL with buffer editor?

I am not looking for an IDE or integrated REPL. I just wanted to ask if someone knows if it is possible to have a buffer editor in the REPL as know from 'psql' or some *nix shells. In psql for example you just enter "\e" and you'll get the last…
Benjamin Peter
  • 3,654
  • 2
  • 17
  • 23
6
votes
1 answer

Use JLine to Complete Multiple Commands on One Line

I was wondering how I could implement an ArgumentCompleter such that if I complete a full and valid command, then it would begin tab completing for a new command. I would have assumed it could be constructed doing something like this: final…
flakes
  • 12,841
  • 5
  • 28
  • 69
6
votes
4 answers

clojure/lein REPL with jline

For some reason I can't get clojure REPL working with jline, what i did was git clone the clojure repository off github then run ant to build it, then i download jline-0.9.94.jar to the directory with clojure.jar, then run the following…
vito huang
  • 3,482
  • 6
  • 21
  • 21
6
votes
2 answers

readline-like library for Java

Which readline-like library for Java do you use? By 'readline' like library I mean library for editing console input, with support for history, tab-completion, and stuff like this. I'm looking for one, and I cannot choose from so many choices (jLine…
Peter Štibraný
  • 31,128
  • 15
  • 85
  • 114
6
votes
1 answer

JLine only works from IDEA

I have no problem using jline when the code is run within idea. Running with a bat file, the edit characters are not being sent to the terminal. java -classpath…
6
votes
4 answers

Prefill a line with jline

Using either JLine (or JLine2), is it possible to issue a call to readline on a ConsoleReader and have, in addition to the standard prompt, the buffer be pre-filled with a string of my choosing? I have tried to do,…
Philippe
  • 9,009
  • 2
  • 33
  • 54
5
votes
2 answers

JLine example using multi word commands per line

I can't seem to find an example that uses more than one command per line. For example, say I want to write a cli similar to cisco ios, where you may have multiple levels of commands on the one line. eg. first word could be "show", then when you…
user2507605
  • 51
  • 1
  • 3
4
votes
1 answer

JLine3 "Unable to create a system terminal" after build

I just tried to implement JLine with Jansi, but it throws always the same UnsupportedOperationException referring to org.jline.terminal.impl.jansi.JansiSupportImpl#winSysTerminal. Inspecting this method there is only one simple if which decides on…
Felix Gaebler
  • 682
  • 3
  • 20
4
votes
1 answer

"Bad File Descriptor" exception because of using nohup

My application can be launched via Terminal in linux OS as shell executable file. I have no issues while executing it normally, however when i execute it along with 'nohup' command , it logs below exception in 'nohup.out' file `Exception in thread…
shardul
  • 61
  • 6
4
votes
1 answer

IntelliJ IDEA doesn't intercept JLine code completion in bebug mode

I tried to run simple Java application wich is used code completion. When I run it in separate console it works like a charm. But when I try to it via IntelliJ IDEA, then my IDE doesn't intercept code completion actions in debug mode. I tried to add…
Alex
  • 1,781
  • 4
  • 25
  • 41
1
2 3 4 5 6