KetraTerm
API · DevelopmentAll versions

TerminalShellIntegrationView

Read-only, live projection of the selected shell producer.

All reads and registrations are thread-safe; separate calls need not observe the same revision. Primitive copies write only caller-owned destinations. Metadata snapshots allocate only when requested. The producer owns records and clearing; consumers own their listener registrations. This role conveys no publication or producer lifetime authority.

Inheritors

Properties

Link copied to clipboard
abstract val revision: StateFlow<Long>

Invalidation signal for prompt, command, and current-directory metadata.

Functions

Link copied to clipboard

Observes future explicit command completions without replay or conflation.

Link copied to clipboard

Observes future changed directory URIs synchronously, without replay.

Link copied to clipboard
abstract fun commandAnchorLineId(recordId: Int): Long

Returns the preferred navigation anchor line for recordId.

Link copied to clipboard

Returns an immutable metadata snapshot for recordId.

Link copied to clipboard
abstract fun commandRecordIdAtLine(lineId: Long): Int

Returns the retained command record that owns lineId.

Link copied to clipboard
abstract fun commandText(recordId: Int): String?

Returns the retained command text for recordId.

Link copied to clipboard
abstract fun commandWorkingDirectoryUri(recordId: Int): String?

Returns the working-directory URI snapshotted when recordId began.

Link copied to clipboard
abstract fun copyCommandBlockRange(recordId: Int, destination: LongArray, destinationOffset: Int = 0): Boolean

Copies the selectable prompt/input-and-output line range for recordId.

Link copied to clipboard
abstract fun copyCommandOutputRange(recordId: Int, destination: LongArray, destinationOffset: Int = 0): Boolean

Copies the command-output line range for recordId.

Link copied to clipboard
abstract fun copyRecords(recordIds: IntArray, lifecycleStates: IntArray, promptStartLineIds: LongArray, promptEndLineIds: LongArray, commandStartLineIds: LongArray, commandEndLineIds: LongArray, exitCodes: IntArray, destinationOffset: Int, maxRecords: Int): Int

Copies retained shell command records into caller-owned primitive arrays.

Link copied to clipboard
abstract fun copyViewport(lineIds: LongArray, rowCount: Int, promptStarts: BooleanArray, commandStarts: BooleanArray, commandEnds: BooleanArray, commandRecordIds: IntArray, commandLifecycleStates: IntArray, failedCommandRails: BooleanArray? = null, destinationOffset: Int = 0)

Copies projected shell decorations for a visible viewport.

Link copied to clipboard

Returns the latest recorded directory URI, or null before one is recorded.

Link copied to clipboard
abstract fun hasRunningCommand(): Boolean

Returns true while shell integration reports a command between command-start and command-finished events.

Link copied to clipboard
abstract fun latestCommandRecordId(): Int

Returns the newest retained command record id, skipping prompt-only records.

Link copied to clipboard
abstract fun nextCommandRecordId(recordId: Int): Int

Returns the next retained command record after recordId.

Link copied to clipboard
abstract fun nextCommandRecordIdAfterLine(lineId: Long): Int

Returns the nearest retained command record after lineId.

Link copied to clipboard
abstract fun previousCommandRecordId(recordId: Int): Int

Returns the previous retained command record before recordId.

Link copied to clipboard

Returns the nearest retained command record before lineId.

Link copied to clipboard
abstract fun recordCount(): Int

Returns the current number of retained shell command records.