Class Console

java.lang.Object
protocols.apps.chat.ui.Console

public class Console extends Object
A tiny mIRC-style terminal, built on JLine. The point of using JLine (rather than plain System.in/out) is the fixed input line: you can keep typing at the bottom while incoming messages scroll in above, without your half-typed line getting scrambled.

Two threads touch this:

  • Constructor Details

  • Method Details

    • printAbove

      public void printAbove(String line)
      Print a line above the input prompt (safe to call from any thread).
    • start

      public void start(Consumer<String> onLine, Runnable onQuit)
      Start the input loop on a daemon thread. onLine is called for every entered line; onQuit runs when the user hits Ctrl-C / Ctrl-D or the input stream ends.
    • stop

      public void stop()