You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since isatty seems to be bound to make it in the stdlib (ocaml/ocaml#11128), I'm willing to use caml_sys_tty primitive (available since this ocaml/ocaml@a69e3e3 which went into 4.03).
Nothing fancy except turning quoted material into bold.
A few things would need to be sorted out though, e.g. how to control it via a default option (mandatory or not) and interaction with existing user options like Fmt_cli provides that do the same.
I guess people are going to mention the NO_COLOR environment variable but it's a rather stupid standard, this comment explains it well.
The text was updated successfully, but these errors were encountered:
In fact in general I'm no longer convinced by isatty being a good signal to inform the default behaviour for styling. isatty is false when you page a program's output. But it's often good to have colors in this case; like most git diff users will likely agree with by now.
In any case for cmdliner this is not going to be fancy. We just want to use bold for quoting and perhaps a red for highlighting errors. It is also always only be used for reporting command line errors, so I don't think it needs to be more sophisticated than this:
Use ANSI styles unconditionally except if TERM is dumb or unset (the latter is true in browser consoles but I don't expect cmdliner error messages to show up in browser consoles).
Since
isatty
seems to be bound to make it in the stdlib (ocaml/ocaml#11128), I'm willing to usecaml_sys_tty
primitive (available since this ocaml/ocaml@a69e3e3 which went into4.03
).Nothing fancy except turning quoted material into bold.
A few things would need to be sorted out though, e.g. how to control it via a default option (mandatory or not) and interaction with existing user options like
Fmt_cli
provides that do the same.I guess people are going to mention the
NO_COLOR
environment variable but it's a rather stupid standard, this comment explains it well.The text was updated successfully, but these errors were encountered: