Package nz.org.riskscape.engine.cli
Class JlineTerminal
java.lang.Object
nz.org.riskscape.engine.cli.BaseTerminal
nz.org.riskscape.engine.cli.JlineTerminal
- All Implemented Interfaces:
Consumer<nz.org.riskscape.problem.Problem>
,nz.org.riskscape.cli.Terminal
,nz.org.riskscape.problem.ProblemSink
A Terminal
implementation that is backed by a Jline terminal. A Jline terminal has good cross
platform support for getting terminal widths and detection of ctrl-c whilst reading input lines.
-
Field Summary
Fields inherited from class nz.org.riskscape.engine.cli.BaseTerminal
DEFAULT_TTY_WIDTH, defaultAnsi, showStackTrace, TERMINAL_HEIGHT_UNLIMITED
Fields inherited from interface nz.org.riskscape.problem.ProblemSink
DEVNULL
Fields inherited from interface nz.org.riskscape.cli.Terminal
ELLIPSIS, EMPTY_TEXT, NO_STYLES
-
Constructor Summary
ConstructorDescriptionJlineTerminal
(org.jline.terminal.Terminal jlineTerminal, nz.org.riskscape.engine.i18n.Messages messages) -
Method Summary
Methods inherited from class nz.org.riskscape.engine.cli.BaseTerminal
getAnsi, getFallbackHandler, getLocale, log, setFallbackHandler, wrapAsUncloseable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nz.org.riskscape.problem.ProblemSink
accept
Methods inherited from interface nz.org.riskscape.cli.Terminal
println, printProblems, printProblems
-
Constructor Details
-
JlineTerminal
public JlineTerminal(org.jline.terminal.Terminal jlineTerminal, nz.org.riskscape.engine.i18n.Messages messages)
-
-
Method Details
-
readline
- Throws:
IOException
-
getDisplayWidth
public int getDisplayWidth() -
getDisplayHeight
public int getDisplayHeight() -
isTTY
public boolean isTTY()- Specified by:
isTTY
in interfacenz.org.riskscape.cli.Terminal
- Overrides:
isTTY
in classBaseTerminal
- Returns:
- true if this terminal is connected to a TTY.
-
updateStatus
-
getErr
-
getAnsiErr
public nz.org.riskscape.cli.AnsiPrintStream getAnsiErr() -
getOut
-
getAnsiOut
public nz.org.riskscape.cli.AnsiPrintStream getAnsiOut() -
getIn
-