GothenburgBitFactory / taskwarrior

Taskwarrior - Command line Task Management
https://taskwarrior.org
MIT License
4.43k stars 303 forks source link

Bold text doesn't work in the reports #2587

Open akim-13 opened 3 years ago

akim-13 commented 3 years ago

I set color.due=bold in my taskrc

When running task colors legend it appears bold, however in any of the reports it doesn't change anything. I use Alacritty as my terminal.

The output of the task diag command:

task 2.5.3
   Platform: Linux

Compiler
    Version: 10.2.0
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      Built: Feb  2 2021 23:45:39
      CMake: 3.19.4
    libuuid: libuuid + uuid_unparse_lower
  libgnutls: 3.7.0
 Build type:

Configuration
       File: /home/akim/.config/taskwarrior/taskrc (found), 3326 bytes, mode 100644
       Data: /home/akim/.local/share/taskwarrior (found), dir, mode 40755
     TASKRC: /home/akim/.config/taskwarrior/taskrc
   TASKDATA: /home/akim/.local/share/taskwarrior
    Locking: Enabled
         GC: Enabled
    $EDITOR: nvim
     Server: inthe.am:53589
         CA: ~/.config/taskwarrior/inthe.am/ca.crt, readable, 2405 bytes
Certificate: ~/.config/taskwarrior/inthe.am/private.certificate.pem, readable, 2710 bytes
        Key: ~/.config/taskwarrior/inthe.am/private.key.pem, readable, 17747 bytes
      Trust: strict
    Ciphers: NORMAL
      Creds: inthe_am/akimkomir/************************************

Hooks
     System: Enabled
   Location: /home/akim/.config/taskwarrior/hooks
     Active: on-modify.timewarrior (executable)
   Inactive:

Tests
   Terminal: 310x66
       Dups: Scanned 144 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 144 tasks for broken references:
             No broken references found
lambtho12 commented 3 years ago

Same issue with kitty

sebu06 commented 3 years ago

Hi, the issue might actually be that the coloring rules are applied in a specific order. (e.g. tagged before due) You can control the precedence of the colors using the rule.precedence.color configuration parameter.

In order to reproduce the problem, could you share a minimal .taskrc + example? You can simply override the .taskrc using task rc:foo.rc if you add

data.location=~/tmptask
color.due=bold

to foo.rc and create a task using

task rc:foo.rc add foo due:1d

and view it using

task rc:foo.rc

does it appear bold? But if you add a tag, it is not bold anymore:

task rc:foo.rc add foo due:1d
task rc:foo.rc

Once you add the precedence rule rule.precedence.color=due to foo.rc, it will appear bold.

Best, Sebastian

vanya-robertson commented 7 months ago

That is true, but this is only considering one modification; if using either rule.precedence.color=due,tag.next or rule.precedence.color=tag.next,due, neither turns bold. Desired behaviour would be where the leftmost attribute defined in rule.precedence.color supersedes the ones to its right. This currently functions with both foreground and background text colours, but not boldness. Rectification would enhance functionality, permitting more customisable reports and not detrimenting current configurations.