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

do not require a coloured Unicode terminal for opam-ci #6

Open
avsm opened this issue Jun 12, 2018 · 7 comments
Open

do not require a coloured Unicode terminal for opam-ci #6

avsm opened this issue Jun 12, 2018 · 7 comments
Labels
enhancement opam-ci opam-ci tool related

Comments

@avsm
Copy link
Member

avsm commented Jun 12, 2018

The current dashboard display requires an ANSI and Unicode tty due to the use of colours. This is not optimal for several reasons:

  • it makes it difficult to use with screen readers
  • file redirection is messy
  • it also fails to work on Windows due to Consolas not supporting the right format (via @dra27)

We should fallback to a more verbose rendering format in these situations instead of blasting escape codes to the screen unconditionally.

@samoht
Copy link
Contributor

samoht commented Jun 12, 2018

Also it doesn't help with copy/pasting code. Ideally the success and failure symbols should just be different, even if they have different colors. I advise to pick a consistent style, e.g. all successes are in circles and errors in square boxes or something like that.

@avsm
Copy link
Member Author

avsm commented Jun 12, 2018

Agreed, but the difficulty here is just finding a good Unicode symbol set that also renders on Windows. Suggestions very welcome -- the relevant code to be factored is in src/opam-ci/user.ml#L24

@avsm avsm added enhancement opam-ci opam-ci tool related labels Jun 12, 2018
@trefis
Copy link

trefis commented Jun 15, 2018

To go a bit further: I think a --ascii option is desirable (even though it makes the output less compact).

@samoht
Copy link
Contributor

samoht commented Jun 15, 2018

One idea could be to use a simple table instead of encoding the same information again and again on every line.

So instead of:

                     alcotest-async          0.8.2  ③ ④ ⑤ ⑥ ⑦ ⑧   🄳 🄰 🅄 🄵 🅂   ⓧ ⓐ ⓟ   ∬ fl ⚐
                            datakit         0.12.0  ③ ④ ⑤ ⑥ ⑦ ⑧   🄳 🄰 🅄 🄵 🅂   ⓧ ⓐ ⓟ   ∬ fl ⚐
              datakit-bridge-github         0.12.0  ③ ④ ⑤ ⑥ ⑦ ⑧   🄳 🄰 🅄 🄵 🅂   ⓧ ⓐ ⓟ   ∬ fl ⚐

Have something like that:

                               ③ ④ ⑤ ⑥ ⑦ ⑧   🄳 🄰 🅄 🄵 🅂   ⓧ ⓐ ⓟ   ∬ fl ⚐
alcotest-async        0.8.2    ✓  ✓  ✓  ✓ ✗  ✗   ✓  ✗  ✗  ✗  ✓   ✓  ✓  ✓   ✓ ✗ ✗
datakit               0.12.0   ✓  ✓  ✓  ✓ ✗  ✗   ✓  ✗  ✗  ✗  ✓   ✓  ✓  ✓   ✓ ✗ ✗
datakit-bridge-github 0.12.0   ✗  ✓  ✓  ✗ ✗  ✗   ✓  ✗  ✗  ✗  ✓   ✗  ✓  ✓   ✓ ✗ ✓

@samoht
Copy link
Contributor

samoht commented Jun 15, 2018

Also it would be nice if the columns to display should be customisable, for instance using a config file. Also maybe it's not worth showing the columns where everything is fine :-)

@dbuenzli
Copy link

dbuenzli commented Jun 19, 2018

Since you are already using Fmt, you might be interested in using Fmt_tty which has support for configuring conditional UTF-8 output and ANSI coloring in some kind of standard way.

Besides Fmt_cli has a cmdliner fragment to handle an explicit --color argument, possibly baked by a custom environment variable.

Here's a sample usage for the coloring bits.

@lpw25
Copy link

lpw25 commented Jul 11, 2018

Could you also use other unicode for the symbols for debian, alpine etc.? I don't have any fonts that can display these letters in boxes symbols, and I imagine I am not alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement opam-ci opam-ci tool related
Projects
None yet
Development

No branches or pull requests

5 participants