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

Coloring on Windows #3909

Closed
toots opened this issue Jul 1, 2019 · 2 comments
Closed

Coloring on Windows #3909

toots opened this issue Jul 1, 2019 · 2 comments

Comments

@toots
Copy link

toots commented Jul 1, 2019

Hi,

We're using the coloring code from opam in our project and I noticed that it was enabled when running the program on windows, which leads to terminal control characters leaking to the printed screen. Evidently, coloring is not supported there.

Shouldn't this line:

not Sys.win32
have the opposite boolean, i.e.:

let dumb_term = lazy (
  try
    Sys.getenv "TERM" = "dumb"
  with Not_found -> Sys.win32
)
@dra27
Copy link
Member

dra27 commented Jul 2, 2019

It's intentional - TERM will not usually be set on Windows, so while TERM=dumb will disable the colour output on Windows, the absence of the TERM environment variable is not taken as being a dumb terminal.

What do you mean by "printed screen" - are you seeing an effect like #3897?

@toots
Copy link
Author

toots commented Jul 2, 2019

Yes, I'm seeing terminal color code inside the cmd.exe prompt. Honestly, this is all well above my head and I don't really care that much for coloring on windows. I'll close this one if you say this is intended. I'm down to learn more about how to do terminal coloring on windows properly if you have some pointers but I'm already thankful for your time reviewing this!

@toots toots closed this as completed Jul 2, 2019
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

No branches or pull requests

2 participants