nponeccop
nponeccop

Reputation: 13677

Termcaps for log-like terminals such as github/gitlab CI environments

GitLab and GitHub both support coloring their output with escape sequences.

But GitLab (I didn't test the default TERM value in GitHub) sets TERM=dumb which is a good default, but techincally incorrect, I guess, as it is misleading about the capabilities.

Is there any predefined terminfo entry which describes the GitLab terminal emulation capabilities correctly, or just better than dumb?

If not, is there any way to systematically test the capabilities and write a custom definition?

I understand that a lot of software doesn't use termcaps, and maybe only understands a hardcoded list of xterm, dumb and linux. My goal isn't making it actually working with pre-existing software, there are adhoc options for that often (such as --color=always)

Upvotes: 3

Views: 492

Answers (1)

timblaktu
timblaktu

Reputation: 435

You could define a simple termcap that at least defines the known ANSI color capabilities, but it would probably need to define all other caps as unsupported, at least until more light can be shone on the other underlying capabilities of GitLab runner terminals.

Example of the supported ANSI color sequences in GitLab CI Runner "terminals": https://gitlab.com/dgoo2308/readability_colors/-/blob/master/.gitlab-ci.yml

Upvotes: 0

Related Questions