Skip to content

Conversation

@v0idpwn
Copy link
Contributor

@v0idpwn v0idpwn commented May 17, 2023

Fixes issue reported in #12564 comments.

According to https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fileno?view=msvc-170 when there is no associated output stream to stdout, _fileno returns -2 without setting an error, which causes otp to return ebadf on prim_tty:isatty. Its not clear yet if this behaviour is intended, and a bug report will be filed for otp.

Either way, considering that the signature of the function is true | false | ebadf, I think elixir should use == true as a condition to enable ANSI.

@josevalim josevalim merged commit 03aa566 into elixir-lang:main May 17, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants