1. 14 May, 2018 23 commits
  2. 11 May, 2018 12 commits
  3. 10 May, 2018 5 commits
    • Lubomir Rintel's avatar
    • Lubomir Rintel's avatar
      cli: allow setting the colors with terminal-colors.d(5) · bcc9e58b
      Lubomir Rintel authored
      The present version of the specification is somewhat unclear at times,
      Unclear points were discussed with the maintainers [1] and probably
      some new version will address those.
      
      https://www.spinics.net/lists/util-linux-ng/msg15222.html
      
      Until then here's how the implementation copes with ambiguities
      (after the discussion with util-linux maintainers):
      
      1.) It is unclear whether multiple .schem files should override each
          other or be merged. We use the overriding behavior -- take the
          highest priority one and ignore the rest.
      
      2.) We assume "name.schem" is more specific than "@term.schem".
      
      3.) We assume the "Color name" are to be used as aliases for the color
          sequences and translate them to ANSI escape sequences.
      
      4.) The "Escape sequences" are of no use since the specification
          pretty much assumes an ANSI terminal and none of the sequences make
          any sense in ANSI color codes. We don't support them.
          accept that.
      
      5.) We don't implement TERMINAL_COLORS_DEBUG because it's unspecified
          what should it do.
      bcc9e58b
    • Lubomir Rintel's avatar
      cli: use a palette to implement coloring · 31aa2cfe
      Lubomir Rintel authored
      This basically replaces the (NMMetaTermColor, NMMetaTermFormat) combo
      with NMMetaColor that describes the colored element semantically as
      opposed to storing the raw attributes.
      
      A (currently static) paletted is used to translate the semantic color
      code to the actual ANSI controle sequence. This matches what
      terminal-colors.d(5) schemes use, making it convenient to implement
      customizable palettes.
      31aa2cfe
    • Lubomir Rintel's avatar
      cli: rework enabling and disabling colors · 9dfe8258
      Lubomir Rintel authored
      This actually makes very little difference at the moment, but will make
      things more confortable later on, when the logic of enabling/disabling
      coloring will involve terminal-colors.d(5).
      
      Instead of deciding whether to use colors lazily with use_colors(), it's
      done very early on nmcli initialization and a boolean use_colors field
      is stored in the NmcConfig instance instead of the raw tristate option
      of NmcColorOption type (which is now confined to nmcli.c).
      
      Wherever the NmcColorOption was used previously, the whole NmcConfig
      instance is passed around. That might seem pointless (since only the
      use_colors boolean is actually used at the moment), but will be utilized
      to pass around the actual color palette in future.
      9dfe8258
    • Lubomir Rintel's avatar
      cli: drop --prompt-color · 56a5b273
      Lubomir Rintel authored
      It's undocumented, useless, somewhat expensive in volume of code and
      probably just downright stupid. We'll get a more general way to set
      colors.
      
      Hacking in some code to keep this working wouldn't be too difficult, but
      it seems entirely pointless.
      56a5b273