Skip to content

Commit ea46f5c

Browse files
committed
Use ANSI clear-to-EOL if color is force-enabled
When running cargo with output not going to a TTY, and with the progress bar and color force-enabled, this makes cargo clean up its right-aligned output properly. This doesn't fix the case where progress is force-enabled and color isn't, but it fixes the case where both are force-enabled.
1 parent c68432f commit ea46f5c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/cargo/core/shell.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ impl Shell {
185185

186186
/// Erase from cursor to end of line.
187187
pub fn err_erase_line(&mut self) {
188-
if let ShellOut::Stream {
189-
stderr_tty: true, ..
190-
} = self.output
191-
{
188+
if self.err_supports_color() {
192189
imp::err_erase_line(self);
193190
self.needs_clear = false;
194191
}

0 commit comments

Comments
 (0)