Class AbstractTerminals

java.lang.Object
net.rubygrapefruit.platform.internal.AbstractTerminals
All Implemented Interfaces:
NativeIntegration, Terminals
Direct Known Subclasses:
PosixTerminals, WindowsTerminals

public abstract class AbstractTerminals extends Object implements Terminals
  • Constructor Details

    • AbstractTerminals

      public AbstractTerminals()
  • Method Details

    • withAnsiOutput

      public Terminals withAnsiOutput()
      Description copied from interface: Terminals
      Returns a copy of this terminal access that forces terminal output to use ANSI escape sequences. This can be used to force rich terminal output when not attached to a terminal.

      Terminal input is not changed.

      Specified by:
      withAnsiOutput in interface Terminals
    • getTerminal

      public TerminalOutput getTerminal(Terminals.Output output)
      Description copied from interface: Terminals
      Returns the terminal attached to the given output.
      Specified by:
      getTerminal in interface Terminals
      Returns:
      The terminal. Never returns null.
    • getTerminalInput

      public TerminalInput getTerminalInput() throws NativeException
      Description copied from interface: Terminals
      Returns the terminal attached to system input
      Specified by:
      getTerminalInput in interface Terminals
      Returns:
      The terminal. Never returns null.
      Throws:
      NativeException - When the input is not attached to a terminal.
    • createInput

      protected abstract TerminalInput createInput()
    • createTerminal

      protected abstract AbstractTerminal createTerminal(Terminals.Output output)