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

public class JlineTerminal extends BaseTerminal

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.

  • Constructor Details

    • JlineTerminal

      public JlineTerminal(org.jline.terminal.Terminal jlineTerminal, nz.org.riskscape.engine.i18n.Messages messages)
  • Method Details

    • readline

      public String readline() throws IOException
      Throws:
      IOException
    • getDisplayWidth

      public int getDisplayWidth()
    • getDisplayHeight

      public int getDisplayHeight()
    • isTTY

      public boolean isTTY()
      Specified by:
      isTTY in interface nz.org.riskscape.cli.Terminal
      Overrides:
      isTTY in class BaseTerminal
      Returns:
      true if this terminal is connected to a TTY.
    • updateStatus

      public void updateStatus(List<String> lines)
    • getErr

      public PrintStream getErr()
    • getAnsiErr

      public nz.org.riskscape.cli.AnsiPrintStream getAnsiErr()
    • getOut

      public PrintStream getOut()
    • getAnsiOut

      public nz.org.riskscape.cli.AnsiPrintStream getAnsiOut()
    • getIn

      public InputStream getIn()