create

fun create(looper: Looper = Looper.getMainLooper(), initialRows: Int = 24, initialCols: Int = 80, defaultForeground: Color = Color.White, defaultBackground: Color = Color.Black, onKeyboardInput: (ByteArray) -> Unit = {}, onBell: () -> Unit? = null, onResize: (TerminalDimensions) -> Unit? = null, onClipboardCopy: (String) -> Unit? = null, onProgressChange: (ProgressState, Int) -> Unit? = null, autoDetectUrls: Boolean = false, boldAsBright: Boolean = true): TerminalEmulator(source)

Creates the default implementation of TerminalEmulator.

Parameters

looper

The Looper to use for callback handling (typically main looper)

initialRows

Initial number of rows

initialCols

Initial number of columns

defaultForeground

Default foreground color

defaultBackground

Default background color

onKeyboardInput

Callback for keyboard output (to write to PTY)

onBell

Optional callback for terminal bell

onResize

Optional callback for terminal resize

onClipboardCopy

Optional callback for OSC 52 clipboard copy operations. The callback receives the decoded text to copy.

onProgressChange

Optional callback for OSC 9;4 progress reporting. The callback receives the progress state and percentage (0-100).

autoDetectUrls

Whether to continuously scan visible terminal line text for plain-text URLs and expose them via hit-testing as a fallback when no OSC 8 hyperlink covers the column. Defaults to false. TerminalEmulator.getUrls always performs its own one-shot regex URL scan regardless of this setting.

boldAsBright

Whether bold text using low-intensity ANSI colors (0–7) promotes to the corresponding bright palette color (8–15), matching xterm's default boldColors behavior. Defaults to true.