klyn.process.PseudoTerminal.readAvailable
method
public readAvailable() as String
Description

Reads a currently available output batch without waiting for future input. A transport may bound the batch to preserve GUI responsiveness; remaining bytes stay queued for subsequent calls, without a session/output quota. KlynOS currently delivers up to 64 KiB per call over 256-byte transport operations. Read again on later polls to drain larger output.

A process can exit between an empty read and an isRunning query. After observing exit, read again before closing to retain its final output. Complete output already queued remains readable after process exit; close releases the transport and its unread bytes.

Returns

Terminal bytes decoded as UTF-8 text. Returns an empty string when no complete text is available. A partial UTF-8 scalar is retained until its remaining bytes arrive; malformed or truncated final UTF-8 fails explicitly rather than being replaced or silently discarded.

Example
chunk = pty.readAvailable()
if chunk != "":
    print(chunk)