isPasteSafe static method

bool isPasteSafe(
  1. String text
)

Returns whether text is safe enough to paste without user confirmation.

This follows the same protection model used by modern terminals such as Ghostty: newlines and bracketed-paste terminators can inject commands, while terminal control bytes can alter terminal state. paste still sanitizes the payload; this method is for UI confirmation decisions.

Implementation

static bool isPasteSafe(String text) => _isPasteSafe(text);