scoop:scoop.terminal.asyncio:0.1.0
scoop.terminal.asyncio
API
-
class
AsyncTerminalSession
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.
-
function
cursorPosition
Queries the cursor position while preserving unrelated input events. Temporarily enables raw mode when needed and waits up to the supplied timeout.
-
function
deviceAttributes
Queries primary or secondary device attributes and returns the terminal's numeric parameters. Unrelated input remains available to normal reads.
-
function
execute
Writes each terminal command in order and then flushes the asynchronous byte sink.
-
function
keyboardEnhancementFlags
Queries active keyboard-enhancement flags. Returns None when the terminal responds through the unsupported-protocol fallback.
-
function
queue
Writes each terminal command in order to the asynchronous byte sink without flushing. Cancellation is checked before output begins.
-
function
supportsKeyboardEnhancement
Queries whether the terminal advertises keyboard-enhancement support, using the same timeout and input preservation as [keyboardEnhancementFlags].
-
function
withRawMode
Runs a suspending block in raw mode and restores the previous non-raw state on exit when this scope changed it. Already-raw sessions retain their mode.