Terminal

Types

Link copied to clipboard
interface Capabilities
Link copied to clipboard
class Size(val columns: Int, val rows: Int, val width: Int = 0, val height: Int = 0)
Link copied to clipboard
interface State
Link copied to clipboard

Properties

Link copied to clipboard

Whether suspendProcess is supported. It needs job control, which Windows does not have, and only applies to the terminal the process was started in, not, for example, a remote one.

Link copied to clipboard
Link copied to clipboard
abstract val events: ReceiveChannel<Event>
Link copied to clipboard
abstract val interactive: Boolean
Link copied to clipboard
abstract val name: String?
Link copied to clipboard
abstract val state: Terminal.State

Functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
open suspend fun <T> released(block: suspend () -> T): T

Restores the terminal to how it was before this took it over while block runs, so that other programs can use it, like an editor or an interactive command, and takes it over again afterwards. No events are read meanwhile, so they go to those programs instead.

Link copied to clipboard
open suspend fun suspendProcess(): Boolean

Stops the process like Ctrl+Z normally does in a shell, with the terminal released, and returns once the shell continues it, like with fg. Returns false right away when canSuspendProcess is false.