LCOV - code coverage report
Current view: top level - src/util - terminal.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 10 10.0 %
Date: 2025-03-25 01:19:55 Functions: 1 2 50.0 %
Branches: 0 6 0.0 %

           Branch data     Line data    Source code
       1                 :            : #include <mutable/util/terminal.hpp>
       2                 :            : 
       3                 :            : #include <mutable/util/fn.hpp>
       4                 :            : #include <cstdlib>
       5                 :            : 
       6                 :            : 
       7                 :          0 : bool m::term::has_color()
       8                 :            : {
       9                 :          0 :     constexpr const char *SUPPORTED_TERMS[] = {
      10                 :            :         "ansi",
      11                 :            :         "color",
      12                 :            :         "cygwin",
      13                 :            :         "linux",
      14                 :            :         "rxvt-unicode-256color",
      15                 :            :         "vt100",
      16                 :            :         "xterm",
      17                 :            :         "xterm-256",
      18                 :            :         "xterm-256color",
      19                 :            :     };
      20         [ #  # ]:          0 :     if (auto term = std::getenv("TERM")) {
      21         [ #  # ]:          0 :         for (auto supported : SUPPORTED_TERMS) {
      22         [ #  # ]:          0 :             if (m::streq(term, supported))
      23                 :          0 :                 return true;
      24                 :            :         }
      25                 :          0 :     }
      26                 :          0 :     return false;
      27                 :          0 : }

Generated by: LCOV version 1.16