class AsyncTerminalSession
source · line 15public class AsyncTerminalSession private constructor(
internal val tty: AsyncTty,
private val loop: EventLoop,
parser: InputParser
) : AsyncByteSink, AsyncCloseable
- Supertype
AsyncByteSink - Supertype
AsyncCloseable
An event-loop-bound terminal session combining parsed input, terminal queries, raw-mode control, and asynchronous output. Operations require an active job on the owning loop; close the session after use.
Extensions
public suspend fun AsyncTerminalSession.deviceAttributes(kind: DeviceAttributeKind = DeviceAttributeKind.Primary, timeout: Duration = Duration.seconds(1L)): Array<Long>· scoop:scoop.terminal.asyncio:0.1.0public suspend fun AsyncTerminalSession.cursorPosition(timeout: Duration = Duration.seconds(1L)): CursorPosition· scoop:scoop.terminal.asyncio:0.1.0public suspend fun AsyncTerminalSession.supportsKeyboardEnhancement(timeout: Duration = Duration.seconds(1L)): Boolean· scoop:scoop.terminal.asyncio:0.1.0public suspend fun AsyncTerminalSession.keyboardEnhancementFlags(timeout: Duration = Duration.seconds(1L)): KeyboardEnhancementFlags?· scoop:scoop.terminal.asyncio:0.1.0public suspend fun <R> AsyncTerminalSession.withRawMode(block: suspend () -> R): R· scoop:scoop.terminal.asyncio:0.1.0
function enableRawMode
source · line 122public suspend fun enableRawMode(): Unit
Enables raw terminal input while reserving session input and output access.
function isRawMode
source · line 113public suspend fun isRawMode(): Boolean
Reads the actual terminal mode and refreshes the session's tracked raw-mode state.
function close
source · line 150public override suspend fun close(): Unit
- Overrides
close
Closes the terminal handle and waits for active session operations to leave their access scopes. Repeated closes after cleanup return immediately.
function flush
source · line 142public override suspend fun flush(): Unit
- Overrides
flush
Waits for buffered terminal output to be flushed.
function writeFrom
source · line 137public override suspend fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Writes readable buffer bytes through the terminal handle and advances the buffer by actual progress.
parameter buffer
source · line 137buffer: NativeByteBuffer
parameter count
source · line 137count: Long
function size
source · line 105public suspend fun size(): TerminalSize
Reads the terminal dimensions, including pixel dimensions when the host supplies them.
property isClosed
source · line 26public val isClosed: Boolean
get: public read-only
Whether the underlying asynchronous terminal handle is closed.
getter get
source · line 26get(): Boolean
function poll
source · line 96public suspend fun poll(timeout: Duration): Boolean
Waits up to a nonnegative timeout for a parsed input event without consuming the event. A zero timeout checks current availability.
parameter timeout
source · line 96timeout: Duration
function disableRawMode
source · line 129public suspend fun disableRawMode(): Unit
Restores non-raw terminal input. Cleanup can call this even when the active job is cancelling.
function read
source · line 91public suspend fun read(): Event
Waits for the next parsed keyboard, mouse, paste, focus, or resize event.