pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.62k stars 207 forks source link

Formatting doesn't work with `watch` #811

Open david-jointech opened 6 years ago

david-jointech commented 6 years ago

When using watch --color khal calendar the formatting (bold text and colors) doesn't seem to work.

I don't know exactly if this is an issue with khal or if it is one with watch. But watch does work for me with other programs (for example todotxt doesn't lose its color or boldness), so I am guessing khal is doing something differently here.

Using khal without watch (even with sh) works as expected. Does someone have an idea what the problem could be?

david-jointech commented 6 years ago

Okay, I figured it out. watch --color khal --color does the trick. Only the calendar-color doesn't get shown, which I guess has to do with that one not being part of the shells color-theme.

geier commented 6 years ago

Still sounds like a bug then, I'll reopen the issue. Can you post the output?

david-jointech commented 6 years ago

Which output exactly? The one from watch --color khal? If I read the help correctly it kinda works as intended: --color / --no-color Use colored/uncolored output. Default is to only enable colors when not part of a pipe.. I guess watch does count as a pipe and thus disables colors.

pacien commented 5 years ago
$ watch --color khal --color

Doesn't display any color for me, while khal alone (without watch) does colorize the output. Both commands are able to display bold text.


$ khal --version
khal, version 0.9.9

$ watch --version
watch from procps-ng 3.3.15
pacien commented 5 years ago

This seems to be an issue with the watch command itself. Other command line tools such as taskwarrior are also impacted equally.

Foreground colors not in the 16 colors palette are displayed in the default color. Background colors aren't displayed at all.

khal should perhaps try to match the closest available color in this case.