KetraTerm
API · DevelopmentAll versions

applyGraphicsCommand

abstract fun applyGraphicsCommand(command: TerminalGraphicsCommand, data: ByteArray, length: Int, result: TerminalGraphicsResult, allowReplies: Boolean)

Applies a complete command using the Base64-decoded prefix data[0 until length]. command and data are borrowed for this call. Raw RGB/RGBA pixels are copied into immutable storage before returning; upload-only and query operations do not place an image. Placement uses the current cursor and known cell-pixel geometry.

result carries upstream transfer validation failure. An unsuccessful operation does not replace retained images or move the cursor. allowReplies controls response permission, not mutation; false suppresses every success/failure reply. Eligible replies are queued for TerminalResponseChannel.readResponseBytes.

Parameters

command

borrowed, complete Kitty controls with their original units and omissions.

data

borrowed Base64-decoded transfer storage; bytes after length are ignored.

length

valid byte count in 0..data.size; placement/deletion commands require zero.

result

TerminalGraphicsResult.OK for an assembled transfer to validate, or its upstream failure outcome, which prevents command mutation.

allowReplies

whether otherwise eligible success and failure replies may be queued.

Throws

if length is outside 0..data.size.