Skip to content

Add an option/variable to print progress bar in a machine-readable format #7587

Closed
@mchernyavsky

Description

@mchernyavsky

Hi there!

Describe the problem you are trying to solve

I'm working on Build Tool Window support in IntelliJ Rust, and I need to parse build progress bar. In the current implementation, to get cargo to print progress bar, I use the pty4j library to emulate PTY, but

  1. It's a very fragile solution which can easily break during future development.
  2. It has some bugs.
  3. For simplicity, I remove all color sequences from the text. If I want to support colors, it will become very difficult to parse messages because of the ASCII control sequences. I already tried to implement this (RUN: Support for ANSI colors in build tool window intellij-rust/intellij-rust#4254), but on Windows, it doesn't work well.

Describe the solution you'd like

I would like to have an option or environment variable so that cargo prints the progress bar to the console on a separate line without any \r, Erase in Line-sequences, etc.

p.s. - Ideally, I would like, when using a --message-format=json..., cargo would output all messages in JSON. Currently, only compiler messages are output in JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions