Interface Terminals
- All Superinterfaces:
NativeIntegration
- All Known Implementing Classes:
AbstractTerminals,PosixTerminals,WindowsTerminals
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 -
Method Summary
Modifier and TypeMethodDescriptiongetTerminal(Terminals.Output output) Returns the terminal attached to the given output.Returns the terminal attached to system inputbooleanisTerminal(Terminals.Output output) Returns true if the given output is attached to a terminal.booleanReturns true if the system input is attached to a terminal.Returns a copy of this terminal access that forces terminal output to use ANSI escape sequences.
-
Method Details
-
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
Returns true if the given output is attached to a terminal.- Throws:
NativeException- On failure.
-
isTerminalInput
Returns true if the system input is attached to a terminal.- Throws:
NativeException
-
getTerminal
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
Returns the terminal attached to system input- Returns:
- The terminal. Never returns null.
- Throws:
NativeException- When the input is not attached to a terminal.
-