loom & weft
Made for Swift.

Published release 0.2.1. Unreleased PR #2 reference.

LOOM 0.2.1 / 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

Structure
struct TerminalCapabilities

Conforms 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:16

colorDepth

Instance Property
var colorDepth: TerminalColorDepth

Expected terminal color encoding.

Source · TerminalCapabilities.swift:17

synchronizedOutput

Instance Property
var synchronizedOutput: Bool

Whether writes are enclosed in synchronized-output escape sequences.

Source · TerminalCapabilities.swift:18

kittyKeyboard

Instance Property
var kittyKeyboard: Bool

Whether the environment suggests Kitty keyboard support.

Source · TerminalCapabilities.swift:20

colorSchemeReporting

Instance Property
var colorSchemeReporting: Bool

A public field of this type. Its value type and mutability are shown in the declaration.

Source · TerminalCapabilities.swift:21

apply(_:)

Instance Method
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.
Source · TerminalCapabilities.swift:40

inferred(environment:)

Type Method
static func inferred(environment: [String : String] = ProcessInfo.processInfo.environment) -> TerminalCapabilities

Infers a safe output profile from the process environment.

Parameters (1)
environment
Environment hints used to infer optional terminal features.

Returns TerminalCapabilities.

Source · TerminalCapabilities.swift:53

report

Instance Property
var report: String { get }

A concise report suitable for terminal diagnostics.

Source · TerminalCapabilities.swift:83