Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / SUPPORTING WEFT TYPES
TerminalCapabilities
Environment hints, not proof of emulator support. This type is not re-exported by loom: depend on/import weft explicitly. Pass its inferred output choices into Terminal; Terminal’s defaults differ from the conservative capability defaults.
Defined by weft, with no loom typealias. Add the weft product to your target and use import weft when referring to this type by name.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Example
let capabilities = TerminalCapabilities.inferred()
_ = Terminal(backend: ANSIBackend(), width: 80, height: 24,
synchronizedOutput: capabilities.synchronizedOutput, colorDepth: capabilities.colorDepth,
hyperlinks: capabilities.hyperlinks)Members on this page
Feature guides and release status
TerminalCapabilities
struct TerminalCapabilitiesConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
A conservative terminal profile, initially inferred from the environment.
Environment variables are hints rather than proof, especially across SSH or tmux. Applications can override individual choices after a successful probe or a user setting. Unsupported or unknown optional protocols default off.
Source · TerminalCapabilities.swift:16colorDepth
var colorDepth: TerminalColorDepthExpected terminal color encoding.
Source · TerminalCapabilities.swift:17synchronizedOutput
var synchronizedOutput: BoolWhether writes are enclosed in synchronized-output escape sequences.
Source · TerminalCapabilities.swift:18hyperlinks
var hyperlinks: BoolWhether HTTP(S) cell links may be emitted as OSC 8 links.
Source · TerminalCapabilities.swift:19kittyKeyboard
var kittyKeyboard: BoolWhether the environment suggests Kitty keyboard support.
Source · TerminalCapabilities.swift:20colorSchemeReporting
var colorSchemeReporting: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · TerminalCapabilities.swift:21init(colorDepth:synchronizedOutput:hyperlinks:kittyKeyboard:colorSchemeReporting:)
init(colorDepth: TerminalColorDepth = .ansi16, synchronizedOutput: Bool = false, hyperlinks: Bool = false, kittyKeyboard: Bool = false, colorSchemeReporting: Bool = false)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (5)
colorDepth- Argument type and any default are shown in the declaration; see the behavior notes above.
synchronizedOutput- Argument type and any default are shown in the declaration; see the behavior notes above.
hyperlinks- Argument type and any default are shown in the declaration; see the behavior notes above.
kittyKeyboard- Argument type and any default are shown in the declaration; see the behavior notes above.
colorSchemeReporting- Argument type and any default are shown in the declaration; see the behavior notes above.
apply(_:)
mutating func apply(_ reply: TerminalReply)Updates only features confirmed by a report.
Timeouts should leave this profile unchanged.
Parameters (1)
reply- Argument type and any default are shown in the declaration; see the behavior notes above.
inferred(environment:)
static func inferred(environment: [String : String] = ProcessInfo.processInfo.environment) -> TerminalCapabilitiesInfers a safe output profile from the process environment.
Parameters (1)
environment- Environment hints used to infer optional terminal features.
Returns TerminalCapabilities.
report
var report: String { get }A concise report suitable for terminal diagnostics.
Source · TerminalCapabilities.swift:83