Using JLine

scgray edited this page Apr 9, 2012 · 2 revisions

This page provides information to users that are running programs that are utilizing JLine for command line editing. JLine behavior can be customized by embedding programs, such as remapping keys to different functionality or enabling and disabling specific features, so not everything here may apply to the program that you are using.

Startup

Upon startup, JLine looks for and attempts to read the file $HOME/.jline.rc. This file can contain set of configuration properties that can change specific aspects of JLine's behavior. These settings are covered in detail, on the Configuration Properties page.

Next, the file $HOME/.inputrc is read. The format and definition of this file is defined by GNU Readline and is documented here.. For the majority of users, this file is not necessary or is usually used to specify the default editing mode with:

set editing-mode emacs

or

set editing-mode vi

However, JLine does attempt honor as many of the settings in your .inputrc file as possible, including conditional settings (for example, binding a specific key only if being run withing a specific program).

Unless a specific terminal type was specified in your .jline.rc file, JLine will attempt to determine your terminal type and configure itself accordingly. In most circumstances, this should work just fine, however if issues are encountered (e.g. your arrow keys don't work), please see the page on terminal configuration.

Finally, many programs will also load the command line history from previous sessions so that you may immediately recall old history, however this behavior is not enforced by JLine and the embedding program may store these history files in any locations or forms.

History and Command Line Editing

As discussed in the previous section, JLine may be configured with one of two key bindings: emacs or vi. JLine attempts to mimic as much of the behavior of GNU Readline as possible with respect to these modes, so for details on how to use either of these modes, please refer to the Readline documentation for details. However, suffice it to say that all of the standard keys, such as arrow keys, backspace, delete, home, end, etc. should function as expected.

Unsupported Features

While JLine supports many of the "common" features of readline, it is not a complete clone and is currently missing a number of features. It is hoped that eventually JLine will become as feature-for-feature compatible with readline as possible, but until then, here is a list of the most visible incomplete features:

  • Undo/redo
  • Others?
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.