gnzlbg / cargo-asm

cargo subcommand showing the assembly or llvm-ir generated for Rust code
https://github.com/gnzlbg/cargo-asm
Other
1.17k stars 36 forks source link

cargo-asm prints color codes even when stdout is not a terminal #197

Open bheisler opened 4 years ago

bheisler commented 4 years ago

When I try to run cargo asm <args> | less I see a bunch of escape codes in less. It would be nice if cargo-asm could detect if stdout is a terminal, or at least provide a --color=never option.

malaire commented 3 years ago

I don't think this is a bug as you might want color codes when stdout is not terminal, e.g. to save to file which you then open in editor which supports color codes.

Also there is already --no-color to not output colors.