pub(super) use crate::human::sanitize_terminal_text as strip_terminal_controls;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn strips_color_title_and_hyperlink_controls() {
let input =
"\x1b[31mred\x1b[0m \x1b]0;title\x07ok \x1b]8;;https://example.com\x07link\x1b]8;;\x07";
assert_eq!(strip_terminal_controls(input), "red ok link");
}
#[test]
fn preserves_unicode_tabs_and_newlines() {
assert_eq!(
strip_terminal_controls("東京\tline\nnext"),
"東京\tline\nnext"
);
}
}