Interface Terminals
-
- All Superinterfaces:
NativeIntegration
- All Known Implementing Classes:
AbstractTerminals,PosixTerminals,WindowsTerminals
public interface Terminals extends NativeIntegration
Provides access to the terminal/console.On UNIX based platforms, this provides access to the terminal. On Windows platforms, this provides access to the Windows console and Mintty.
To create an instance of this interface use the
Native.get(Class)method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTerminals.OutputSystem outputs.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TerminalOutputgetTerminal(Terminals.Output output)Returns the terminal attached to the given output.TerminalInputgetTerminalInput()Returns the terminal attached to system inputbooleanisTerminal(Terminals.Output output)Returns true if the given output is attached to a terminal.booleanisTerminalInput()Returns true if the system input is attached to a terminal.TerminalswithAnsiOutput()Returns a copy of this terminal access that forces terminal output to use ANSI escape sequences.
-
-
-
Method Detail
-
withAnsiOutput
Terminals withAnsiOutput()
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.
-
isTerminal
boolean isTerminal(Terminals.Output output) throws NativeException
Returns true if the given output is attached to a terminal.- Throws:
NativeException- On failure.
-
isTerminalInput
boolean isTerminalInput() throws NativeExceptionReturns true if the system input is attached to a terminal.- Throws:
NativeException
-
getTerminal
TerminalOutput getTerminal(Terminals.Output output) throws NativeException
Returns the terminal attached to the given output.- Returns:
- The terminal. Never returns null.
- Throws:
NativeException- When the output is not attached to a terminal.
-
getTerminalInput
TerminalInput getTerminalInput() throws NativeException
Returns the terminal attached to system input- Returns:
- The terminal. Never returns null.
- Throws:
NativeException- When the input is not attached to a terminal.
-
-