git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/3] chainlint: sidestep impoverished macOS "terminfo"

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Nov 11, 2022, 17:15 UTC
Message-ID
<CAPig+cRCSg=iVLUmLG=W47ofojU56CcFsobNZK5z5h9LdzXs0Q@mail.gmail.com>
In-Reply-To
<CAPig+cRwDeGyniiVGqmdMePgmR6GiYQOvNP+GUeT__zpuWV1Fg@mail.gmail.com>
On Fri, Nov 11, 2022 at 11:44 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 10 quoted lines
> On Fri, Nov 11, 2022 at 10:02 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
> > I also wonder to what extent this needs to be re-inventing
> > Term::ANSIColor, which has shipped with Perl since 5.6, so we can use it
> > without worrying about version compat, but that's another topic...
>
> Gah, why didn't I know about this sooner?! [...]
>
> Since it's been shipping with Perl for quite some time,
> Term::ANSIColor would be a much nicer solution; worth looking into.

In retrospect, I may have looked at Term::ANSIColor at the time but decided to avoid it since it assumes the terminal understands ANSI codes, and I was looking for a more general solution which respected the terminal's capabilities as reported by "terminfo".

And, reading up on it now, I'm not finding much benefit to Term::ANSIColor over what is already implemented in chainlint.pl. Particularly disheartening is that (as far as I can tell) Term::ANSIColor doesn't provide a way to interrogate whether or not it is suitable to use ANSI codes with the terminal in question, but instead makes a blanket assumption that the terminal supports ANSI codes unconditionally.

So, I think the fixed-up colorizing as implemented by v2 of this patch series is good enough for now. It can always be revisited later if something warrants it.

Previous: Eric SunshineNext: Taylor Blau
Message 16 of 20 in “chainlint: emit line numbers alongside test definitions”
  1. 0/3 chainlint: emit line numbers alongside test definitionsEric Sunshine via GitGitGadget, Nov 9, 2022
  2. 1/3 chainlint: sidestep impoverished macOS "terminfo"Eric Sunshine via GitGitGadget, Nov 9, 2022
  3. Taylor BlauNov 9, 2022
  4. brian m. carlsonNov 10, 2022
  5. Eric SunshineNov 10, 2022
  6. brian m. carlsonNov 10, 2022
  7. Eric SunshineNov 10, 2022
  8. brian m. carlsonNov 10, 2022
  9. 2/3 chainlint: latch line numbers at which each token starts and endsEric Sunshine via GitGitGadget, Nov 9, 2022
  10. 3/3 chainlint: prefix annotated test definition with line numbersEric Sunshine via GitGitGadget, Nov 9, 2022
  11. Taylor BlauNov 9, 2022
  12. 0/3 chainlint: emit line numbers alongside test definitionsEric Sunshine via GitGitGadget, Nov 11, 2022
  13. 1/3 chainlint: sidestep impoverished macOS "terminfo"Eric Sunshine via GitGitGadget, Nov 11, 2022
  14. Ævar Arnfjörð BjarmasonNov 11, 2022
  15. Eric SunshineNov 11, 2022
  16. Eric SunshineNov 11, 2022
  17. Taylor BlauNov 11, 2022
  18. 2/3 chainlint: latch line numbers at which each token starts and endsEric Sunshine via GitGitGadget, Nov 11, 2022
  19. 3/3 chainlint: prefix annotated test definition with line numbersEric Sunshine via GitGitGadget, Nov 11, 2022
  20. Ævar Arnfjörð BjarmasonNov 11, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.