bacon icon indicating copy to clipboard operation
bacon copied to clipboard

Bacon strips ANSI escape codes and skips newlines on test output.

Open LFS6502 opened this issue 3 months ago • 2 comments

When using bacon, it looks like all ANSI escape codes are removed from the test's panic output. Is this intended? If so, I'd be nice for it not to.

cargo test

Image

bacon on test mode

Image

Code to reproduce: https://github.com/LFS6502/aperture/tree/e82ae86bc088f5f659c66ffb6b0c81876c87e5b5

LFS6502 avatar Sep 24 '25 21:09 LFS6502

This seems related to #382

LFS6502 avatar Sep 24 '25 21:09 LFS6502

When you run cargo test > somefile, the output of cargo test is already stripped from control codes. It looks like cargo test doesn't have a way to force outputting escape codes when the output isn't a TTY. Standard arguments like --color always seem to be ignored.

This is probably a duplicate of https://github.com/Canop/bacon/issues/193

Canop avatar Sep 29 '25 14:09 Canop