Skip to content

Conversation

@lauft
Copy link
Member

@lauft lauft commented Dec 6, 2025

During fix of GothenburgBitFactory/timewarrior#727, I noticed that the Table component does its own TTY check (in line Table.cpp:103) to decide whether the output is piped and thus should not be colored.

It can be overridden, but only to enforce color in otherwise uncolored output. However, it is not possible to enforce uncolored output in a TTY. There is the :nocolor hint, but it is not passed to the table, and the override only lets one switch color on, but not explicitly off.

For better handling, the check for TTY should be done in only the application and passed to the table.

Relates to GothenburgBitFactory/timewarrior#730

@lauft lauft requested review from djmitche and tbabej December 6, 2025 22:12
Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you be able to make a corresponding change to taskwarrior?

@lauft lauft force-pushed the feature/remove-tty-check branch from 5d227f5 to 693f33e Compare December 7, 2025 11:31
Check for tty should be done in the application and passed to the table.
Replace tty check with explicit setting for colored output.

Relates to GothenburgBitFactory/timewarrior#727 GothenburgBitFactory/timewarrior#730

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
@lauft lauft force-pushed the feature/remove-tty-check branch from 693f33e to 46b30b0 Compare December 7, 2025 15:42
@lauft lauft merged commit 3da1534 into master Dec 7, 2025
18 checks passed
@lauft lauft deleted the feature/remove-tty-check branch December 7, 2025 20:21
@lauft
Copy link
Member Author

lauft commented Dec 7, 2025

@djmitche I have created GothenburgBitFactory/taskwarrior#4005 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants