Package org.aesh.terminal.http
Class HttpDevice
java.lang.Object
org.aesh.terminal.BaseDevice
org.aesh.terminal.http.HttpDevice
- All Implemented Interfaces:
Device
Device implementation for HTTP-based terminal connections.
Supports dynamic terminal type updates based on client capability reporting. When a web client connects, it can report its terminal type and capabilities, which this device will use to load the appropriate terminfo data.
- Author:
- Ståle W. Pedersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aesh.terminal.Device
Device.OscCode, Device.TerminalType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault terminal type for web-based terminals. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new HTTP device with the default terminal type (xterm-256color).HttpDevice(String type) Creates a new HTTP device with the specified terminal type. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBooleanCapability(Capability capability) Returns the client-reported features.getNumericCapability(Capability capability) Returns the client-reported color depth as a string.getStringCapability(Capability capability) Returns the client's user agent string.booleanhasFeature(String feature) Checks if the client reported a specific feature.voidsetFeatures(List<String> features) Sets the client-reported features.voidsetReportedColorDepth(String colorDepth) Sets the client-reported color depth.voidUpdates the terminal type and reloads terminfo data.voidsetUserAgent(String userAgent) Sets the client's user agent string.type()Methods inherited from class org.aesh.terminal.BaseDevice
getStringCapabilityAsInts, puts, putsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aesh.terminal.Device
detectTerminalType, getColorDepth, getImageProtocol, isJetBrainsTerminal, isMultiplexer, isTmuxPassthroughEnabled, supportsGraphemeClusterMode, supportsHyperlinks, supportsImages, supportsOscCode, supportsOscQueries, supportsShellIntegration, supportsSynchronizedOutput, supportsThemeQuery
-
Field Details
-
DEFAULT_TYPE
Default terminal type for web-based terminals.- See Also:
-
-
Constructor Details
-
HttpDevice
public HttpDevice()Creates a new HTTP device with the default terminal type (xterm-256color). -
HttpDevice
Creates a new HTTP device with the specified terminal type.- Parameters:
type- the terminal type (e.g., "vt100", "xterm-256color")
-
-
Method Details
-
setType
Updates the terminal type and reloads terminfo data.This is typically called when the client reports its capabilities.
- Parameters:
type- the new terminal type
-
setReportedColorDepth
Sets the client-reported color depth.- Parameters:
colorDepth- the color depth (e.g., "TRUE_COLOR", "256", "16")
-
getReportedColorDepth
Returns the client-reported color depth as a string.- Returns:
- the color depth, or null if not reported
-
setFeatures
Sets the client-reported features.- Parameters:
features- list of feature names (e.g., "UNICODE", "CLIPBOARD")
-
getFeatures
Returns the client-reported features.- Returns:
- list of feature names, or null if not reported
-
setUserAgent
Sets the client's user agent string.- Parameters:
userAgent- the user agent string
-
getUserAgent
Returns the client's user agent string.- Returns:
- the user agent, or null if not reported
-
hasFeature
Checks if the client reported a specific feature.- Parameters:
feature- the feature to check (e.g., "UNICODE", "CLIPBOARD")- Returns:
- true if the feature was reported
-
type
- Specified by:
typein interfaceDevice- Overrides:
typein classBaseDevice
-
getBooleanCapability
- Specified by:
getBooleanCapabilityin interfaceDevice- Overrides:
getBooleanCapabilityin classBaseDevice
-
getNumericCapability
- Specified by:
getNumericCapabilityin interfaceDevice- Overrides:
getNumericCapabilityin classBaseDevice
-
getStringCapability
- Specified by:
getStringCapabilityin interfaceDevice- Overrides:
getStringCapabilityin classBaseDevice
-