Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / TERMINAL ALIASES FROM WEFT
TerminalError
Session, TTY, input/output, configuration, unsupported-operation, and platform failures. POSIX errors carry errno; native Windows errors retain their operation and code. Propagate renderer write failures and arrange session cleanup.
loom.TerminalError is an alias for weft.TerminalError. It is available through import loom. The underlying type’s members are documented here.
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
do {
let session = try TerminalSession()
session.close()
} catch let error as TerminalError {
switch error {
case .requiresTTY: break
default: throw error
}
}Members on this page
Feature guides and release status
TerminalError
typealias TerminalError = weft.weft.TerminalErrorSession, TTY, input/output, configuration, unsupported-operation, and platform failures. POSIX errors carry errno; native Windows errors retain their operation and code. Propagate renderer write failures and arrange session cleanup.
Source · TerminalExports.swift:12Underlying weft API
TerminalError
enum TerminalErrorConforms to: Swift.Equatable, Swift.Error, Swift.Sendable, Swift.SendableMetatype.
A failure to open, configure, read from, or write to the terminal.
Source · TerminalError.swift:2requiresTTY
case requiresTTYInput/output do not provide the TTY required for an interactive session.
Source · TerminalError.swift:3sessionAlreadyActive
case sessionAlreadyActiveAnother process-wide terminal session is already active.
Source · TerminalError.swift:4sessionClosed
case sessionClosedA session operation was attempted after close.
Source · TerminalError.swift:5sessionSuspended
case sessionSuspendedThe session suspended case. Associated values, if any, are shown in the declaration.
Source · TerminalError.swift:6inputSourceActive
case inputSourceActiveAn asynchronous source already owns decoded input.
Source · TerminalError.swift:8invalidQuery
case invalidQueryThe invalid query case. Associated values, if any, are shown in the declaration.
Source · TerminalError.swift:9queryAlreadyPending
case queryAlreadyPendingThe query already pending case. Associated values, if any, are shown in the declaration.
Source · TerminalError.swift:10tooManyQueries
case tooManyQueriesThe too many queries case. Associated values, if any, are shown in the declaration.
Source · TerminalError.swift:11unsupportedOperation(operation:)
case unsupportedOperation(operation: String)The platform does not supply the requested operation.
Source · TerminalError.swift:13configurationFailed(operation:code:)
case configurationFailed(operation: String, code: Int32)A native operation failed; code is the captured errno or Windows error code.
inputClosed
case inputClosedThe session input read failed or input closed.
Source · TerminalError.swift:16inputModeConflict
case inputModeConflictDecoded and byte input polling cannot share one session.
Source · TerminalError.swift:18outputFailed
case outputFailedWriting terminal output failed.
Source · TerminalError.swift:19