From 271e28f609726bb4f29b2e87ef7edfaa73b67987 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 15 Nov 2015 14:35:28 -0500 Subject: [PATCH] CmdSync: Color only used for tty --- src/commands/CmdSync.cpp | 9 +++++++-- src/rules.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/CmdSync.cpp b/src/commands/CmdSync.cpp index a2071db07..c269eac09 100644 --- a/src/commands/CmdSync.cpp +++ b/src/commands/CmdSync.cpp @@ -182,8 +182,13 @@ int CmdSync::execute (std::string& output) std::string code = response.get ("code"); if (code == "200") { - Color colorAdded (context.config.get ("color.sync.added")); - Color colorChanged (context.config.get ("color.sync.changed")); + Color colorAdded; + Color colorChanged; + if (context.color ()) + { + colorAdded = Color (context.config.get ("color.sync.added")); + colorChanged = Color (context.config.get ("color.sync.changed")); + } int download_count = 0; payload = response.getPayload (); diff --git a/src/rules.cpp b/src/rules.cpp index f61b45670..7a25cdb67 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -289,7 +289,7 @@ static void colorizeDeleted (Task& task, const Color& base, Color& c, bool merge void autoColorize (Task& task, Color& c) { // The special tag 'nocolor' overrides all auto and specific colorization. - if (!context.color () || + if (! context.color () || task.hasTag ("nocolor")) { c = Color ();