Package org.aesh.terminal.tty
Class TerminalBuilder
java.lang.Object
org.aesh.terminal.tty.TerminalBuilder
Builder for creating Terminal instances with configurable input/output streams and settings.
- Author:
- Stale W. Pedersen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns a Terminal instance with the configured settings.static TerminalBuilderbuilder()Creates a new TerminalBuilder instance.static Terminalconsole()Creates and returns a default system Terminal.input(InputStream in) Sets the input stream for the terminal.Sets the terminal name.nativeSignals(boolean nativeSignals) Sets whether to use native signal handling.output(OutputStream out) Sets the output stream for the terminal.system(boolean system) Sets whether to use the system terminal.Sets the terminal type (e.g., "xterm", "ansi", "dumb").
-
Method Details
-
console
Creates and returns a default system Terminal.- Returns:
- a new Terminal instance
- Throws:
IOException- if an I/O error occurs while creating the terminal
-
builder
Creates a new TerminalBuilder instance.- Returns:
- a new TerminalBuilder
-
name
Sets the terminal name.- Parameters:
name- the terminal name- Returns:
- this builder for method chaining
-
input
Sets the input stream for the terminal.- Parameters:
in- the input stream- Returns:
- this builder for method chaining
-
output
Sets the output stream for the terminal.- Parameters:
out- the output stream- Returns:
- this builder for method chaining
-
system
Sets whether to use the system terminal.- Parameters:
system- true to use system terminal, false otherwise- Returns:
- this builder for method chaining
-
nativeSignals
Sets whether to use native signal handling.- Parameters:
nativeSignals- true to enable native signals, false otherwise- Returns:
- this builder for method chaining
-
type
Sets the terminal type (e.g., "xterm", "ansi", "dumb").- Parameters:
type- the terminal type- Returns:
- this builder for method chaining
-
build
Builds and returns a Terminal instance with the configured settings.- Returns:
- a new Terminal instance
- Throws:
IOException- if an I/O error occurs while creating the terminal
-