Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / TERMINAL ALIASES FROM WEFT
TerminalOptions
Defaults enable raw mode and bracketed paste, while leaving alternate screen, clearing, cursor hiding, mouse capture, and extended keyboards off. clearScrollback permanently removes terminal history. Set only the policies your app needs.
loom.TerminalOptions is an alias for weft.TerminalOptions. 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
let options = TerminalOptions(alternateScreen: true, hideCursor: true, mouseCapture: true)
_ = options.bracketedPasteMembers on this page
Feature guides and release status
TerminalOptions
typealias TerminalOptions = weft.weft.TerminalOptionsDefaults enable raw mode and bracketed paste, while leaving alternate screen, clearing, cursor hiding, mouse capture, and extended keyboards off. clearScrollback permanently removes terminal history. Set only the policies your app needs.
Source · TerminalExports.swift:9Underlying weft API
TerminalOptions
struct TerminalOptionsConforms to: Swift.Equatable, Swift.Sendable, Swift.SendableMetatype.
Terminal policies selected by an application when opening a session.
The defaults enable raw input and bracketed paste without clearing shell history, switching screens, hiding the cursor, or capturing the mouse. Extended keyboard encoding is opt-in because terminal support varies.
Source · TerminalOptions.swift:24rawMode
var rawMode: BoolDisables canonical line buffering and terminal echo for interactive input.
Source · TerminalOptions.swift:25alternateScreen
var alternateScreen: BoolUses a separate full-screen terminal buffer.
Source · TerminalOptions.swift:26clearScreen
var clearScreen: BoolClears the display when the session opens.
Source · TerminalOptions.swift:27clearScrollback
var clearScrollback: BoolClears primary-screen scrollback when the session opens; history removal is permanent.
Source · TerminalOptions.swift:28hideCursor
var hideCursor: BoolHides the cursor when opening the session.
Source · TerminalOptions.swift:29cursorStyle
var cursorStyle: TerminalCursorStyle?Nil preserves the current shape; an explicit style resets to the conventional default on close.
Source · TerminalOptions.swift:31mouseCapture
var mouseCapture: BoolRequests mouse tracking on session open.
Source · TerminalOptions.swift:32bracketedPaste
var bracketedPaste: BoolRequests separately delimited paste events.
Source · TerminalOptions.swift:33focusReporting
var focusReporting: BoolRequest terminal focus reports (DEC private mode 1004).
Disabled by default.
Source · TerminalOptions.swift:37colorSchemeReporting
var colorSchemeReporting: BoolOpt into Contour color-scheme change notifications (DEC private mode 2031).
Source · TerminalOptions.swift:39keyboardProtocol
var keyboardProtocol: TerminalKeyboardProtocolRequested keyboard encoding policy.
Source · TerminalOptions.swift:40maximumPasteBytes
var maximumPasteBytes: IntMaximum UTF-8 bytes retained in a bracketed paste; defaults to 1 MiB.
Source · TerminalOptions.swift:42escapeTimeoutMilliseconds
var escapeTimeoutMilliseconds: IntIdle milliseconds before a lone legacy Escape becomes a key; defaults to 35.
Shared by polling and asynchronous events. Zero resolves Escape immediately; use a longer delay for fragmented input over remote links. Values are clamped to 0...Int32.max when used. Raw-byte input is unaffected.
Source · TerminalOptions.swift:48init(rawMode:alternateScreen:clearScreen:clearScrollback:hideCursor:cursorStyle:mouseCapture:bracketedPaste:focusReporting:colorSchemeReporting:keyboardProtocol:maximumPasteBytes:escapeTimeoutMilliseconds:)
init(rawMode: Bool = true, alternateScreen: Bool = false, clearScreen: Bool = false, clearScrollback: Bool = false, hideCursor: Bool = false, cursorStyle: TerminalCursorStyle? = nil, mouseCapture: Bool = false, bracketedPaste: Bool = true, focusReporting: Bool = false, colorSchemeReporting: Bool = false, keyboardProtocol: TerminalKeyboardProtocol = .legacy, maximumPasteBytes: Int = 1_048_576, escapeTimeoutMilliseconds: Int = 35)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (13)
rawMode- Argument type and any default are shown in the declaration; see the behavior notes above.
alternateScreen- Argument type and any default are shown in the declaration; see the behavior notes above.
clearScreen- Argument type and any default are shown in the declaration; see the behavior notes above.
clearScrollback- Argument type and any default are shown in the declaration; see the behavior notes above.
hideCursor- Argument type and any default are shown in the declaration; see the behavior notes above.
cursorStyle- Argument type and any default are shown in the declaration; see the behavior notes above.
mouseCapture- Argument type and any default are shown in the declaration; see the behavior notes above.
bracketedPaste- Argument type and any default are shown in the declaration; see the behavior notes above.
focusReporting- 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.
keyboardProtocol- Argument type and any default are shown in the declaration; see the behavior notes above.
maximumPasteBytes- Argument type and any default are shown in the declaration; see the behavior notes above.
escapeTimeoutMilliseconds- Argument type and any default are shown in the declaration; see the behavior notes above.