www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21266] New: Improve TTY and color detection in build.d

https://issues.dlang.org/show_bug.cgi?id=21266

          Issue ID: 21266
           Summary: Improve TTY and color detection in build.d
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: greeenify gmail.com

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

--
Sep 19 2020