TestTerminal

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion

Properties

Link copied to clipboard

The client standard input, output, and error streams.

Link copied to clipboard
expect val tty: Tty

The client Tty whose output can be read here by readTty and for which input can be sent with writeTty. Size changes can be sent with resize, along with the Windows-specific sendFocusEvent, sendKeyEvent, and sendMouseEvent.

actual val tty: Tty
actual val tty: Tty

Functions

Link copied to clipboard
expect open override fun close()
actual open override fun close()
actual open override fun close()
Link copied to clipboard

Signal blocking calls to readStandardError or readStandardErrorWithTimeout to wake up and return 0.

Link copied to clipboard

Signal blocking calls to readStandardOutput or readStandardOutputWithTimeout to wake up and return 0.

Link copied to clipboard
expect fun interruptTtyRead()

Signal blocking calls to readTty or readTtyWithTimeout to wake up and return 0.

actual fun interruptTtyRead()
actual fun interruptTtyRead()
Link copied to clipboard
expect fun readStandardError(buffer: ByteArray, offset: Int, count: Int): Int

Read up to count bytes into buffer at offset from the standard error stream. The number of bytes read will be returned. 0 will be returned if interruptStandardErrorRead is called while waiting for data.

actual fun readStandardError(buffer: ByteArray, offset: Int, count: Int): Int
actual fun readStandardError(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun readStandardErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int

Read up to count bytes into buffer at offset from the standard error stream. The number of bytes read will be returned. 0 will be returned if interruptStandardErrorRead is called while waiting for data, or if at least timeoutMillis have passed without data.

actual fun readStandardErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
actual fun readStandardErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
Link copied to clipboard
expect fun readStandardOutput(buffer: ByteArray, offset: Int, count: Int): Int

Read up to count bytes into buffer at offset from the standard output stream. The number of bytes read will be returned. 0 will be returned if interruptStandardOutputRead is called while waiting for data.

actual fun readStandardOutput(buffer: ByteArray, offset: Int, count: Int): Int
actual fun readStandardOutput(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun readStandardOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int

Read up to count bytes into buffer at offset from the standard output stream. The number of bytes read will be returned. 0 will be returned if interruptStandardOutputRead is called while waiting for data, or if at least timeoutMillis have passed without data.

actual fun readStandardOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
actual fun readStandardOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
Link copied to clipboard
expect fun readTty(buffer: ByteArray, offset: Int, count: Int): Int

Read up to count bytes into buffer at offset from the PTY. The number of bytes read will be returned. 0 will be returned if interruptTtyRead is called while waiting for data.

actual fun readTty(buffer: ByteArray, offset: Int, count: Int): Int
actual fun readTty(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun readTtyWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int

Read up to count bytes into buffer at offset from the PTY. The number of bytes read will be returned. 0 will be returned if interruptTtyRead is called while waiting for data, or if at least timeoutMillis have passed without data.

actual fun readTtyWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
actual fun readTtyWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
Link copied to clipboard
expect fun resize(columns: Int, rows: Int, width: Int, height: Int)

Resize the TTY.

actual fun resize(columns: Int, rows: Int, width: Int, height: Int)
actual fun resize(columns: Int, rows: Int, width: Int, height: Int)
Link copied to clipboard
expect fun sendFocusEvent(focused: Boolean)

Send a focus event to tty's callback.

actual fun sendFocusEvent(focused: Boolean)
actual fun sendFocusEvent(focused: Boolean)
Link copied to clipboard
expect fun sendKeyEvent()

Send a key event to tty's callback.

actual fun sendKeyEvent()
actual fun sendKeyEvent()
Link copied to clipboard
expect fun sendMouseEvent()

Send a mouse event to tty's callback.

actual fun sendMouseEvent()
actual fun sendMouseEvent()
Link copied to clipboard
expect fun writeStandardInput(buffer: ByteArray, offset: Int, count: Int): Int

Write up to count bytes into buffer at offset to the standard input stream. If the standard input stream is set to the TTY, this is equivalent to writeTty. The number of bytes written will be returned.

actual fun writeStandardInput(buffer: ByteArray, offset: Int, count: Int): Int
actual fun writeStandardInput(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun writeTty(buffer: ByteArray, offset: Int, count: Int): Int

Write up to count bytes into buffer at offset to the PTY. The number of bytes written will be returned.

actual fun writeTty(buffer: ByteArray, offset: Int, count: Int): Int
actual fun writeTty(buffer: ByteArray, offset: Int, count: Int): Int