Class AbstractTerminal
java.lang.Object
org.aesh.terminal.tty.impl.AbstractTerminal
- All Implemented Interfaces:
Closeable, AutoCloseable, org.aesh.terminal.Terminal
- Direct Known Subclasses:
AbstractPosixTerminal, LineDisciplineTerminal, WinSysTerminal
Abstract base class providing common functionality for terminal implementations.
- Author:
- Stale W. Pedersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aesh.terminal.Terminal
org.aesh.terminal.Terminal.SignalHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.aesh.terminal.DeviceThe device capabilities for this terminal.protected final Map<org.aesh.terminal.tty.Signal, org.aesh.terminal.Terminal.SignalHandler> Map of signal types to their handlers.protected final LoggerLogger for this terminal instance.protected final StringThe terminal name.protected final StringThe terminal type (e.g., "xterm", "vt100").Fields inherited from interface org.aesh.terminal.Terminal
READ_EXPIRED -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTerminal(String name, String type) Creates a new terminal with the specified name and type using default signal handling.AbstractTerminal(String name, String type, org.aesh.terminal.Terminal.SignalHandler signalHandler) Creates a new terminal with the specified name, type, and signal handler. -
Method Summary
Modifier and TypeMethodDescriptionorg.aesh.terminal.Devicedevice()booleanecho()booleanecho(boolean echo) protected voidechoSignal(org.aesh.terminal.tty.Signal signal) Echoes the control character representation of a signal to the terminal output.getName()getType()Returns the terminal type identifier.org.aesh.terminal.Terminal.SignalHandlerhandle(org.aesh.terminal.tty.Signal signal, org.aesh.terminal.Terminal.SignalHandler handler) protected voidhandleDefaultSignal(org.aesh.terminal.tty.Signal signal) Handles the default behavior for a signal when no custom handler is registered.voidraise(org.aesh.terminal.tty.Signal signal) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aesh.terminal.Terminal
getAttributes, getCodePointConsumer, getSize, input, output, peek, read, read, setAttributes, supportsNonBlockingRead
-
Field Details
-
LOGGER
Logger for this terminal instance. -
name
The terminal name. -
type
The terminal type (e.g., "xterm", "vt100"). -
handlers
protected final Map<org.aesh.terminal.tty.Signal, org.aesh.terminal.Terminal.SignalHandler> handlersMap of signal types to their handlers. -
device
protected final org.aesh.terminal.Device deviceThe device capabilities for this terminal.
-
-
Constructor Details
-
AbstractTerminal
-
AbstractTerminal
-
-
Method Details
-
handle
public org.aesh.terminal.Terminal.SignalHandler handle(org.aesh.terminal.tty.Signal signal, org.aesh.terminal.Terminal.SignalHandler handler) - Specified by:
handlein interfaceorg.aesh.terminal.Terminal
-
raise
public void raise(org.aesh.terminal.tty.Signal signal) - Specified by:
raisein interfaceorg.aesh.terminal.Terminal
-
handleDefaultSignal
protected void handleDefaultSignal(org.aesh.terminal.tty.Signal signal) Handles the default behavior for a signal when no custom handler is registered. Subclasses can override this method to provide default signal handling behavior.- Parameters:
signal- the signal to handle
-
echoSignal
protected void echoSignal(org.aesh.terminal.tty.Signal signal) Echoes the control character representation of a signal to the terminal output. For example, SIGINT is echoed as "^C".- Parameters:
signal- the signal whose control character should be echoed
-
echo
public boolean echo()- Specified by:
echoin interfaceorg.aesh.terminal.Terminal
-
echo
public boolean echo(boolean echo) - Specified by:
echoin interfaceorg.aesh.terminal.Terminal
-
getName
- Specified by:
getNamein interfaceorg.aesh.terminal.Terminal
-
getType
Returns the terminal type identifier.- Returns:
- the terminal type (e.g., "xterm", "vt100")
-
device
public org.aesh.terminal.Device device()- Specified by:
devicein interfaceorg.aesh.terminal.Terminal
-