<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Feature request: Enable automatic color output without terminfo"
   href="http://llvm.org/bugs/show_bug.cgi?id=19919">19919</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Feature request: Enable automatic color output without terminfo
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>daniel@constexpr.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12590" name="attach_12590" title="Patch to fall-back to git's algorithm if terminfo is unavailable">attachment 12590</a> <a href="attachment.cgi?id=12590&action=edit" title="Patch to fall-back to git's algorithm if terminfo is unavailable">[details]</a></span>
Patch to fall-back to git's algorithm if terminfo is unavailable

Curretnly llvm needs to be build with terminfo support in order for colors to
be enabled automatically in clang diagnostics.

ncurses/terminfo is a bit of a heavy dependency if all you want is to determine
color support as that is pretty much universal for today's *nix terminal
emulators. This requirement for terminfo was introduced in r187874.

There has been some discussion on this on the mailing lis:
<a href="https://groups.google.com/forum/#!topic/llvm-dev/MqpXVMy6OrM">https://groups.google.com/forum/#!topic/llvm-dev/MqpXVMy6OrM</a>

A suggestion from there that I'd like to see implemented is falling back to the
much simpler algorithm used by git to determine if the terminal supports color
codes:
<a href="https://github.com/git/git/blob/21ff9151e811059f5576ca906c519ee5bb5b925e/color.c#L183">https://github.com/git/git/blob/21ff9151e811059f5576ca906c519ee5bb5b925e/color.c#L183</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>