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

[Bug] stdout colored text displays incorrectly in Windows Command Prompt #609

Closed
0rphon opened this issue Feb 4, 2021 · 5 comments · Fixed by #860
Closed

[Bug] stdout colored text displays incorrectly in Windows Command Prompt #609

0rphon opened this issue Feb 4, 2021 · 5 comments · Fixed by #860
Assignees
Labels
bug Something isn't working

Comments

@0rphon
Copy link
Contributor

0rphon commented Feb 4, 2021

🐛 Bug Report

low priority issue but figured id log it. when using leo in cmd (not powershell) on windows the stdout looks like this

Stack trace & error message

←[1;36m      Done←[0m Program workspace cleaned

←[1;36m Compiling←[0m Starting...
←[1;36m Compiling←[0m Compiling main program... ("D:\\Work\\leo_playground\\src/main.leo")
←[1;36m Compiling←[0m Complete
←[1;36m      Done←[0m Finished in 5 milliseconds

←[1;36m     Setup←[0m Starting...
←[1;36m     Setup←[0m Saving proving key ("D:\\Work\\leo_playground\\outputs/leo_playground.lpk")
←[1;36m     Setup←[0m Complete
←[1;36m     Setup←[0m Saving verification key ("D:\\Work\\leo_playground\\outputs/leo_playground.lvk")
←[1;36m     Setup←[0m Complete
←[1;36m      Done←[0m Finished in 29 milliseconds

←[1;36m   Proving←[0m Starting...
←[1;36m   Proving←[0m Saving proof... ("D:\\Work\\leo_playground\\outputs/leo_playground.proof")
←[1;36m      Done←[0m Finished in 5 milliseconds

←[1;36m Verifying←[0m Starting...
←[1;36m Verifying←[0m Proof is valid
←[1;36m      Done←[0m Finished in 2 milliseconds

Expected Behavior

colored output is supported on windows cmd

Your Environment

  • leo's latest master commit 90fc6a9
  • rustc 1.49.0 (e1884a8e3 2020-12-29)
  • windows 10 build 10.0.19042.746
@0rphon 0rphon added the bug Something isn't working label Feb 4, 2021
@damirka
Copy link
Contributor

damirka commented Feb 15, 2021

Looks like that is missing feature in clap - it does not support Windows in coloring - see docs. Gotta figure out a way to compile for Windows without colors. If you have any ideas - I'm all ears!

@Protryon
Copy link
Contributor

See https://github.com/mackwic/colored README.md: Works on Linux, MacOS, and Windows (Powershell)

AFAIK, windows CMD doesn't support coloring, full stop. Powershell does.

@0rphon
Copy link
Contributor Author

0rphon commented Feb 15, 2021

rust is able to print colored text in windows cmd and ive done so as well on projects
image

@0rphon
Copy link
Contributor Author

0rphon commented Feb 15, 2021

i personally use the colored crate to do it although im sure there are others that work. that and some conditional compilation flags should do the trick

@damirka
Copy link
Contributor

damirka commented Feb 15, 2021

We're using clap's built-in color library, which makes it difficult to patch. Also we're now not only using clap but an abstraction above it - structopt. So quick and harmless solution imo would be to set features correctly and disable coloring on Windows. Since it's a low priority I'd stick with this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants