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

Fix just shows escape code instead of colored text on Windows 10 Console #303

Merged
merged 4 commits into from
Feb 16, 2018

Conversation

gaeulbyul
Copy link
Contributor

image

On Windows 10, just shows escape code instead of colored text.

According to ansi_term crate's README, Application must enable ANSI support for print colored text on Windows 10 Console.

Note for Windows 10 users: On Windows 10, the application must enable ANSI support first:

let enabled = ansi_term::enable_ansi_support();

This commit add ansi_term::enable_ansi_support() into active function.

@casey casey self-requested a review February 16, 2018 08:46
@casey casey merged commit 9eac537 into casey:master Feb 16, 2018
@casey
Copy link
Owner

casey commented Feb 16, 2018

Thank you very much for the PR! I moved the activation code into the run function, so that it's only ever run once.

I'm eager to support Windows users as best I can, so please don't hesitate to report issues as you encounter them.

@casey
Copy link
Owner

casey commented Feb 16, 2018

I have pushed a new release with the fix: https://github.com/casey/just/releases/tag/v0.3.8

The release will be updated with binaries when they are built on Travis and Appveyor.

@casey casey removed their request for review February 16, 2018 09:38
@gaeulbyul
Copy link
Contributor Author

image

Hello, I tried released version (v0.3.8) but same issue reappeared again. but, if I input just --list --color=always, just shows color correctly. Other command shows escape code.

@casey
Copy link
Owner

casey commented Feb 19, 2018

Hmm, very strange. Was it an issue with the changes that I made to your code? Did your version work consistently? I don't have access to a Windows 10 machine at the moment, so it's hard for me to test.

@gaeulbyul
Copy link
Contributor Author

Yes, my version works well. I don't know why it broke again... 😕

@gaeulbyul
Copy link
Contributor Author

Hello, I tried your win10 branch. just --list (without --always option) shows color correctly. but error meesage (just fail) still shows escape code.
However, if I put one more enable_ansi_support() after justfile.run()(src/run.rs:358), error message shows color correctly. putting it before justfile.run() does not effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants