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] Windows Leo CLI colors fail and print escape codes instead #848

Closed
damons opened this issue Apr 9, 2021 · 5 comments · Fixed by #860
Closed

[Bug] Windows Leo CLI colors fail and print escape codes instead #848

damons opened this issue Apr 9, 2021 · 5 comments · Fixed by #860
Assignees
Labels
bug Something isn't working

Comments

@damons
Copy link

damons commented Apr 9, 2021

🐛 Bug Report

While running any Leo CLI command that produces color text on Windows, the resulting text prints escape codes rather than producing color text.

Steps to Reproduce

  1. Install Leo on Windows
  2. Execute leo new test-project
  3. See the attached image for the result.

ansiCLIBug

Expected Behavior

Should look like this:

Screen Shot 2021-04-09 at 2 11 32 PM

Your Environment

Leo 1.2.3
rustc 1.53.0-nightly (2e495d2e8 2021-04-08)
Windows 10 Home v.1909 OS build 18363.628

@damons damons added the bug Something isn't working label Apr 9, 2021
@damirka
Copy link
Contributor

damirka commented Apr 9, 2021

Duplicate of #609.

@damirka
Copy link
Contributor

damirka commented Apr 9, 2021

It is a Clap coloring issue, which can only be solved by turning colors off on Windows builds.

@damons
Copy link
Author

damons commented Apr 9, 2021

Since I installed directly using Cargo, is there a way to turn off colors in our build while compiling on Windows?

And, also, isn't this already implemented in clap? See: https://github.com/clap-rs/clap/pull/1178/files

I'm guessing I'm missing something?

@damirka
Copy link
Contributor

damirka commented Apr 9, 2021

It's not that easy. Here's a link to Clap documentation.

Long story short:

  1. Coloring library which Clap uses does not support Windows;
  2. They have beta 3.0 release which changes that, but it's still beta;
  3. We use StructOpt, which is a wrapper for Clap, and currently it's built on 2.33.3;

The only way for us to fix this bug at this moment is to turn off color feature for Windows builds.

@damirka
Copy link
Contributor

damirka commented Apr 9, 2021

Since I installed directly using Cargo, is there a way to turn off colors in our build while compiling on Windows?

There is a way (or at least should be) - we can specify build features in Cargo.toml. But again, only turning colors off is a solution rn.

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.

2 participants