diff --git a/src/lib.rs b/src/lib.rs index 353ed878f..1f85c0246 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -649,6 +649,11 @@ impl Editor { } fn readline_with(&mut self, prompt: &str, initial: Option<(&str, &str)>) -> Result { + #[cfg(windows)] + debug_assert!( + memchr::memmem::find(prompt.as_bytes(), b"\x1b[").is_none(), + "prompt should not be styled" + ); if self.term.is_unsupported() { debug!(target: "rustyline", "unsupported terminal"); // Write prompt and flush it to stdout