Table of Contents

Method OnSanitizingPaste

Namespace
Terminal.Gui.ViewBase
Assembly
Terminal.Gui.dll

OnSanitizingPaste(string)

Override to filter or transform raw paste payloads before they are inserted into the view. The default implementation strips C0/C1 control characters (including ESC) but preserves tab, line feed, and carriage return — matching Windows Terminal's FilterStringForPaste baseline.

protected virtual string OnSanitizingPaste(string raw)

Parameters

raw string

The raw payload, either from the terminal or the clipboard.

Returns

string

The sanitized text that will be passed to OnPaste(string).

Remarks

TextField overrides this to take only the first line and drop tab/CR/LF. TextView overrides this to normalize \r\n / \r to \n.