paste method

void paste(
  1. String text
)

Similar to textInput, except that when the program tells the terminal that it supports bracketedPasteMode, the text is wrapped in escape sequences to indicate that it is a paste operation. Prefer this method over textInput when pasting text.

See also:

Implementation

void paste(String text) {
  if (_isDisposed) return;
  if (_keyboardActionMode) return;
  final sanitizedText = _sanitizePasteText(text);
  if (_bracketedPasteMode) {
    onOutput?.call(_emitter.bracketedPaste(sanitizedText));
    return;
  }

  onOutput?.call(sanitizedText.replaceAll('\n', '\r'));
}