onInterruptRequest property

void Function(void handler()?)? onInterruptRequest
final

Registers handler to run when the user presses Ctrl-C while this command is executing (e.g. so the AI agent can offer to abort), or clears it with null. The host only invokes the handler when no remote command is in flight (otherwise Ctrl-C interrupts that command). null when the host has no interrupt channel.

Implementation

final void Function(void Function()? handler)? onInterruptRequest;