class TerminalSession
source · line 59public class TerminalSession private constructor(escapeDelay: Duration) : ByteSink, Closeable
- Supertype
ByteSink - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
An owned synchronous terminal session with input parsing, queries, byte output, and raw-mode restoration. Operations on one session must not overlap.
Extensions
public fun <R> TerminalSession.withRawMode(block: () -> R): R· scoop:scoop.terminal:0.1.0public fun TerminalSession.cursorPosition(timeout: Duration = Duration.seconds(1L)): CursorPosition· scoop:scoop.terminal:0.1.0public fun TerminalSession.keyboardEnhancementFlags(timeout: Duration = Duration.seconds(1L)): KeyboardEnhancementFlags?· scoop:scoop.terminal:0.1.0public fun TerminalSession.supportsKeyboardEnhancement(timeout: Duration = Duration.seconds(1L)): Boolean· scoop:scoop.terminal:0.1.0public fun TerminalSession.deviceAttributes(kind: DeviceAttributeKind = DeviceAttributeKind.Primary, timeout: Duration = Duration.seconds(1L)): Array<Long>· scoop:scoop.terminal:0.1.0
function enableRawMode
source · line 124public fun enableRawMode(): Unit
Enables raw input mode, retaining the state needed for restoration.
property isRawMode
source · line 70public val isRawMode: Boolean
get: public read-only
Whether this session currently has raw mode enabled.
getter get
source · line 70get(): Boolean
function disableRawMode
source · line 130public fun disableRawMode(): Unit
Restores the mode saved before raw input was enabled.
function poll
source · line 140public fun poll(timeout: Duration): Boolean
Waits up to a nonnegative duration and reports whether a user event is ready.
parameter timeout
source · line 140timeout: Duration
function close
source · line 171public override fun close(): Unit
- Overrides
close
Restores terminal state and closes the owned handle; close cannot overlap another session operation.
property isClosed
source · line 66public val isClosed: Boolean
get: public read-only
Whether the native terminal handle has been closed.
getter get
source · line 66get(): Boolean
function read
source · line 136public fun read(): Event
Waits for the next user-facing event, preserving query replies for query processing.
function writeFrom
source · line 157public override fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Writes up to count readable bytes to the terminal and advances the input buffer.
parameter count
source · line 157count: Long
parameter buffer
source · line 157buffer: NativeByteBuffer
function size
source · line 120public fun size(): TerminalSize
Queries current character-cell and pixel dimensions.
function flush
source · line 163public override fun flush(): Unit
- Overrides
flush
Checks the unbuffered terminal session state; queued library commands are written immediately.