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
2
votes
0 answers

How to set filecompleter for every command arguments in java jline ConsoleReader?

I need to add file names completer for every command parameters. ConsoleReader consoleReader = new ConsoleReader(); consoleReader.addCompleter(new FileNameCompleter()); consoleReader.addCompleter(new ArgumentCompleter(new…
Supun Induwara
  • 1,594
  • 3
  • 14
  • 22
2
votes
0 answers

Usine JLine2 with SocketInputStream

I am currently trying to include the JLine2 library (version 2.13) for the custom telnet implementation, but, I cannot get it to work. I am creating a ConsoleReader with: ConsoleReader reader = new ConsoleReader("Telnet", socket.getInputStream(), …
Stanislav
  • 110
  • 10
2
votes
0 answers

JLine: File Completion doesn't work on Windows

I want to use JLine to build a simple CLI. But I ran into a problem. File name completer doesn't work properly on Windows. When I enter 8> first C:\ and press tab, completer do nothing although it should display all subfolders. Here is my…
Alex
  • 2,091
  • 6
  • 31
  • 49
2
votes
2 answers

Is it possible to completely mask a password with JLine?

I'm using Spring Shell for a CLI and I want to read a password from the input line. For such purpose spring shell has jline, so using the official documentation [1] of jline it suggests the following: public static void main(String[] args) throws…
Christian Götz
  • 818
  • 1
  • 8
  • 11
2
votes
1 answer

How can I execute a SBT managed JLine class

I'm developing a JLine based application, which I'd obviously like to test as I develop. JLine is a handy library which provides interactive console functionality to JVM applications. JLine doesn't work in the Intellij console, probably because…
irishjava
  • 503
  • 4
  • 11
2
votes
2 answers

JLine, how to get the full filename in Windows

Dear all JLine users, I am recently developing a console application where I use JLine, to provide command and file name completion. It works pretty well with FileNameCompleter but however I cannot get the full file name right. My code is like…
zyzyis
  • 213
  • 3
  • 12
1
vote
1 answer

Windows cmd wrapper bad communication with Clojure and Scala REPLs

I am writing a cmd wrapper which should intercept streams for any cmd application just as any other cmd wrapper would. So far I have succeded and most apps work fine like 'ping' and others. However, when I start Clojure or Scala REPLs, at first…
noncom
  • 4,962
  • 3
  • 42
  • 70
1
vote
2 answers

Spring Shell components don't show up

I'm trying to use the Spring Shell built-in components StringInput, PathInput, ConfirmationInput, SingleSelect and MultiSelect. Each time I try and use one of these by executing the run() method they inherit from AbstractComponent nothing shows up…
1
vote
2 answers

jmxterm: "Unable to create a system terminal" inside Docker container

I have a Docker image which contains JRE, some Java web application and jmxterm. The latter is used for running some ad-hoc administrative tasks. The image is used on the CentOS 7 server with Docker 1.13 (which is pretty old but is the latest…
Danila Kiver
  • 3,418
  • 1
  • 21
  • 31
1
vote
1 answer

JLine not showing chars after using readChar()

I tried to make simple keyboard tester in java so i use Jline for reading chars without pressing ENTER, but when i try to read line from Console it's not showing chars. I tried to use diffrent version of JLine (currently i use 2.14.6), reset…
atomwoz
  • 11
  • 2
1
vote
1 answer

Why does my command prompt show no characters entered?

When I execute my program and I read with either jline's ConsoleReader or with the BufferedReader the text I enter is entered but not shown. For example I type asd, my Console does not show asd, but when I hit enter, it tells me Could not find…
1
vote
1 answer

Jline Terminal Writer Outputting Wrong Formatted Output

We're having some issues with the Jline library terminal when trying to use it's writer. When we try to write a string using the terminal writer's print statement, it's appending characters around the string. Example: When printing:…
Alok Nath Saha
  • 297
  • 1
  • 4
  • 20
1
vote
3 answers

Is there a way to talk to a Clojure REPL process from another process?

I'm wondering if I can make a Vim plugin that sends forms over to the REPL session that lein repl starts. Is there a way to send messages to an existing jline.ConsoleRunner process?
dan
  • 43,914
  • 47
  • 153
  • 254
1
vote
1 answer

How to display command history with jline3?

I want the most recent command entered to be displayed when the user presses the up arrow key. The Terminal is defined like this (Scala code): val terminal: Terminal = TerminalBuilder.builder .system(true) .build The LineReader is defined…
Mike Slinn
  • 7,705
  • 5
  • 51
  • 85
1
vote
1 answer

Java Mockito stuck at doReturn of singleton method

I have a singleton class to help me reading input from the console: public class IOHelper { public org.slf4j.Logger logger = Logger.logger; //JLine public ConsoleReader cr; private static IOHelper instance; private…
pszent
  • 55
  • 1
  • 1
  • 7