Skip to main content

paste_contains_control_chars

Function paste_contains_control_chars 

Source
pub fn paste_contains_control_chars(input: &str) -> bool
Expand description

Check whether a paste string contains dangerous control characters that would be stripped by sanitize_paste_content.

Returns true if the input contains any of:

  • C0 control characters (0x00-0x1F) other than Tab, Newline, Carriage Return
  • ESC (0x1B)
  • DEL (0x7F)
  • C1 control characters (0x80-0x9F) including CSI (0x9B)

Used to generate a warning log entry when warn_paste_control_chars is enabled.