khal icon indicating copy to clipboard operation
khal copied to clipboard

Formatting doesn't work with `watch`

Open david-jointech opened this issue 7 years ago • 5 comments

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 avatar Sep 12 '18 15:09 david-jointech

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.

david-jointech avatar Sep 18 '18 13:09 david-jointech

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

geier avatar Sep 19 '18 07:09 geier

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.

david-jointech avatar Sep 19 '18 17:09 david-jointech

$ 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 avatar Dec 06 '18 20:12 pacien

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.

pacien avatar Dec 17 '18 20:12 pacien