Read lines from the console, with input editing.
It is traditional for an interactive console-based program
to print a short prompt string to signal that the user is expected
to type a command. JLine supports 3 kinds of prompt string:
- The normal prompt at the start (left) of the initial line of a command.
- An optional right prompt at the right border of the initial line.
- A start (left) prompt for continuation lines. I.e. the lines
after the first line of a multi-line command.
All of these are specified with prompt templates,
which are similar to
printf format strings,
using the character
'%' to indicate special functionality.
The pattern may include ANSI escapes.
It may include these template markers:
A line number. This is the sum of
getLineNumber()and a counter starting with 1 for the first continuation line.
A short word explaining what is "missing". This is supplied from
EOFError#getMissing() method, if provided.
Defaults to an empty string.
Insert padding at this possion, repeating the following
character c as needed to bring the total prompt
column width as specified by the digits n.
As before, but use width from the initial prompt.
Text between a
%} pair is printed as
part of a prompt, but not interpreted by JLine
'%'-escapes are processed). The text is assumed
to take zero columns (not move the cursor). If it changes the style,
you're responsible for changing it back. Standard ANSI escape sequences
do not need to be within a
(though can be) since JLine knows how to deal with them. However,
these delimiters are needed for unusual non-standard escape sequences.