Closed AndreaOrru closed 1 year ago
ah, you mean for removing color codes or cursor movements? What's your use case for this? (just wondering, because rexpect can be used for such different use cases)
Yes exactly. I'm building an interactive command prompt and many command outputs are colored, which makes matching text through rexpect
difficult.
P.S. This is for my integration tests.
Sounds like a good use case! Do you have a specific example which could be used to implement and write tests?
Adding to this so it is mentioned somewhere, this also causes issues with Windows ping.exe, which blinks the cursor using escape codes over the R in "Reply from \<ip address>". I think being able to toggle escape code stripping would be ideal, as I imagine there could be use for capturing them.
Is it possible to leverage https://docs.rs/strip-ansi-escapes/0.1.0/strip_ansi_escapes somehow to strip ANSI escape codes from the output?