Skip to main content

printable

Function printable 

Source
pub fn printable(line: &str) -> Cow<'_, str>
Expand description

A line for the terminal, with the characters that it would hide or act on, but line breaks, written as escapes: a carriage return as \r, an escape as \u{1b}, and the invisible ones that hide or reorder text, as a zero-width space or a right-to-left override. So an argument that a script read on Windows, ending in a carriage return, shows it, and a name or path that another device wrote cannot change what the terminal shows in an error, a note or a question. What commands print on standard output is left as it is, for other programs to read.