Issue 21266 - Improve TTY and color detection in build.d
Summary: Improve TTY and color detection in build.d
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords: TestSuite
Depends on:
Blocks:
 
Reported: 2020-09-20 06:30 UTC by Seb
Modified: 2022-12-17 10:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Seb 2020-09-20 06:30:32 UTC
tl;dr: currently build.d always uses -color=on, but this doesn't work on all CIs (e.g. not DAutoTest)

The problem is that some CIs do support these coloring sequences and build.d used to be called via the Makefiles, but I presume people still wanted to have colored log output locally.
Anyhow, the detection code is here:

https://github.com/dlang/dmd/blob/10288e524535a51a061750e118c0144d64d93550/src/build.d#L158-L160

Probably a good idea to stop catering for the makefiles and add a similar TTY detection like DMD's (see below) and detect/hard-code the CIs which support color-coding

https://github.com/dlang/dmd/blob/10288e524535a51a061750e118c0144d64d93550/src/dmd/console.d#L63
https://github.com/dlang/dmd/blob/10288e524535a51a061750e118c0144d64d93550/src/dmd/console.d#L197