loom & weft
Made for Swift.

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

Type Alias
typealias TerminalError = weft.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.

Source · TerminalExports.swift:12

Underlying weft API

TerminalError

Enumeration
enum TerminalError

Conforms to: Swift.Equatable, Swift.Error, Swift.Sendable, Swift.SendableMetatype.

A failure to open, configure, read from, or write to the terminal.

Source · TerminalError.swift:2

requiresTTY

Case
case requiresTTY

Input/output do not provide the TTY required for an interactive session.

Source · TerminalError.swift:3

sessionAlreadyActive

Case
case sessionAlreadyActive

Another process-wide terminal session is already active.

Source · TerminalError.swift:4

sessionClosed

Case
case sessionClosed

A session operation was attempted after close.

Source · TerminalError.swift:5

sessionSuspended

Case
case sessionSuspended

The session suspended case. Associated values, if any, are shown in the declaration.

Source · TerminalError.swift:6

inputSourceActive

Case
case inputSourceActive

An asynchronous source already owns decoded input.

Source · TerminalError.swift:8

invalidQuery

Case
case invalidQuery

The invalid query case. Associated values, if any, are shown in the declaration.

Source · TerminalError.swift:9

queryAlreadyPending

Case
case queryAlreadyPending

The query already pending case. Associated values, if any, are shown in the declaration.

Source · TerminalError.swift:10

tooManyQueries

Case
case tooManyQueries

The too many queries case. Associated values, if any, are shown in the declaration.

Source · TerminalError.swift:11

unsupportedOperation(operation:)

Case
case unsupportedOperation(operation: String)

The platform does not supply the requested operation.

Source · TerminalError.swift:13

configurationFailed(operation:code:)

Case
case configurationFailed(operation: String, code: Int32)

A native operation failed; code is the captured errno or Windows error code.

Source · TerminalError.swift:15

inputClosed

Case
case inputClosed

The session input read failed or input closed.

Source · TerminalError.swift:16

inputModeConflict

Case
case inputModeConflict

Decoded and byte input polling cannot share one session.

Source · TerminalError.swift:18

outputFailed

Case
case outputFailed

Writing terminal output failed.

Source · TerminalError.swift:19