Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mchernyavsky opened this issue Nov 13, 2019 · 0 comments · Fixed by #8165
Closed

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

mchernyavsky opened this issue Nov 13, 2019 · 0 comments · Fixed by #8165
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@mchernyavsky
Copy link
Contributor

mchernyavsky commented Nov 13, 2019

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.

@mchernyavsky mchernyavsky added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Nov 13, 2019
@ehuss ehuss added the A-console-output Area: Terminal output, colors, progress bar, etc. label Dec 3, 2019
@bors bors closed this as completed in c369b8c Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants