mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
commands: Colorize only if color=on is set
Commands 'columns', 'commands' and 'custom' would output color escape sequences desipte color=off being set.
This commit is contained in:
parent
44afdb89e3
commit
e0a808a6ba
4 changed files with 32 additions and 17 deletions
|
@ -70,12 +70,15 @@ int CmdCommands::execute (std::string& output)
|
|||
view.add (Column::factory ("string.right", STRING_COLUMN_LABEL_MISC));
|
||||
view.add (Column::factory ("string.left", STRING_COLUMN_LABEL_DESC));
|
||||
|
||||
Color label (context.config.get ("color.label"));
|
||||
view.colorHeader (label);
|
||||
if (context.color ())
|
||||
{
|
||||
Color label (context.config.get ("color.label"));
|
||||
view.colorHeader (label);
|
||||
|
||||
Color alternate (context.config.get ("color.alternate"));
|
||||
view.colorOdd (alternate);
|
||||
view.intraColorOdd (alternate);
|
||||
Color alternate (context.config.get ("color.alternate"));
|
||||
view.colorOdd (alternate);
|
||||
view.intraColorOdd (alternate);
|
||||
}
|
||||
|
||||
view.leftMargin (context.config.getInteger ("indent.report"));
|
||||
view.extraPadding (context.config.getInteger ("row.padding"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue