GothenburgBitFactory / taskwarrior

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

Support for bold modifier on extended 256-color palette #3668

Closed d2718nis closed 2 weeks ago

d2718nis commented 2 weeks ago

Issue

Currently, only the basic colors (e.g., red, magenta, etc.) can be rendered in bold when configuring theme colors. Attempting to apply the bold modifier to 256-color or RGB color values does not work as expected. Examples:

# These configurations do not work
color.label=bold gray12
color.label.sort=bold color211
color.overdue=bold rgb542

# These configurations do work
color.project.none=bold green
color.recurring=bold

Output from task color legend: screenshot-2024-11-05-16-50-35

Explanation

Most terminals support rendering bold text with colors from the full 256-color palette using ANSI escape sequences. For example:

$ echo -e "\033[1m\033[38;5;183mBold color183\033[0m"

screenshot-2024-11-05-16-00-41

Solution

After some research, I discovered that this issue was actually resolved just over a week ago in this pull request! To implement the fix in Taskwarrior, it just needs to update its libshared dependency to the latest commit.

d2718nis commented 2 weeks ago

Can confirm the bold modifier works properly with all types of colors when built with the latest libshared commit https://github.com/GothenburgBitFactory/libshared/commit/47a750c385133dd14a0957691fe21cbe46e80b10

screenshot-2024-11-05-21-54-37