Fix status line enabled when ANSI colors are forced#6503
Merged
rgrinberg merged 1 commit intoocaml:mainfrom Nov 17, 2022
Merged
Fix status line enabled when ANSI colors are forced#6503rgrinberg merged 1 commit intoocaml:mainfrom
rgrinberg merged 1 commit intoocaml:mainfrom
Conversation
2e00963 to
5a691cf
Compare
rgrinberg
reviewed
Nov 17, 2022
We want to enable the status line if and only if stderr is a tty. ANSI color usage was tweaked in 3.6.0 with ocaml#6340 to allow users to force colors. As status line activation actually depended on whether ANSI colors were enabled or not, this change had the side effect to always enable the status line even when ANSI colors were requested for something that's not a tty. Fix this by exposing a simple lazy wrapper of Unix.isatty to use instead of Ansi_color.stderr_supports_color. Signed-off-by: Antonin Décimo <antonin@tarides.com>
5a691cf to
2166228
Compare
Collaborator
|
FTR I'd like to backport that to 3.6.x |
emillon
pushed a commit
to emillon/dune
that referenced
this pull request
Nov 24, 2022
We want to enable the status line if and only if stderr is a tty. ANSI color usage was tweaked in 3.6.0 with ocaml#6340 to allow users to force colors. As status line activation actually depended on whether ANSI colors were enabled or not, this change had the side effect to always enable the status line even when ANSI colors were requested for something that's not a tty. Fix this by exposing a simple lazy wrapper of Unix.isatty to use instead of Ansi_color.stderr_supports_color. Signed-off-by: Antonin Décimo <antonin@tarides.com>
emillon
added a commit
that referenced
this pull request
Nov 24, 2022
We want to enable the status line if and only if stderr is a tty. ANSI color usage was tweaked in 3.6.0 with #6340 to allow users to force colors. As status line activation actually depended on whether ANSI colors were enabled or not, this change had the side effect to always enable the status line even when ANSI colors were requested for something that's not a tty. Fix this by exposing a simple lazy wrapper of Unix.isatty to use instead of Ansi_color.stderr_supports_color. Signed-off-by: Antonin Décimo <antonin@tarides.com> Signed-off-by: Antonin Décimo <antonin@tarides.com> Co-authored-by: Antonin Décimo <antonin@tarides.com>
emillon
added a commit
to emillon/opam-repository
that referenced
this pull request
Nov 24, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.6.1) CHANGES: - Fix status line enabled when ANSI colors are forced. (ocaml/dune#6503, @MisterDA) - Fix build with MSVC compiler (ocaml/dune#6517, @nojb) - Do not shadow library interface modules (ocaml/dune#6549, fixes ocaml/dune#6545, @rgrinberg)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to enable the status line if and only if stderr is a tty. ANSI color usage was tweaked in 3.6.0 with #6340 to allow users to force colors. As status line activation actually depended on whether ANSI colors were enabled or not, this change had the side effect to always enable the status line even when ANSI colors were requested for something that's not a tty.
Fix this by exposing a simple lazy wrapper of
Unix.isattyto use instead ofAnsi_color.stderr_supports_color.