khal icon indicating copy to clipboard operation
khal copied to clipboard

RGB colours only working with `ikhal` but not in non-interactive commands

Open PartialDragster opened this issue 2 years ago • 8 comments

Hi,

First thanks for making such a great bit of software and second I had a look through open issues and didn't see this one already raised but sorry if I missed it.

I'm using khal version 0.10.3. At the moment if I set the color to an RGB value or use auto to pick the colour used on the server it will work fine in khal interactive

image

but not so fine with khal calendar (which is the one I use more often)

image

If I use the word values for color (i.e. light green, dark red, etc) both work fine.

PartialDragster avatar Nov 28 '22 19:11 PartialDragster

I'm using the following config:

[calendars]

  [[birthdays]]
  path = ~/.local/share/contacts/cards/
  type = birthdays
  color = light magenta

  [[calendars]]
  path = ~/.local/share/calendars/*
  type = discover

And all calendars render with their correct colour with both khal calendar and khal interactive.

Can you post your config (at least the relevant bits)?

WhyNotHugo avatar Nov 29 '22 14:11 WhyNotHugo

(side note: khal interactiverenders the contacts birthdays bold, whereas khal calendar renders them non-bold, so it sees there's some difference in how both interpret the color command).

WhyNotHugo avatar Nov 29 '22 14:11 WhyNotHugo

Hi, thanks for responding and sorry for delayed reply. Interesting note about the bold! As an example with the config entries

[[calendar1]]
path = ~/.config/calendars/ba05fa43-6a68-4cfa-d189-8cf971575e0c/
color="#FF0000"

[[calendar2]]
path = ~/.config/calendars/ef3187cd-cad9-7916-6397-0eb7eee02f1a/
color="#00FF00"

[[calendar3]]
path = ~/.config/calendars/be1c74ae-95de-0cc6-f9e9-b15ba0fe3951/
color="#0000FF"

[[calendar4]]
path = ~/.config/calendars/945dcf76-3b83-3d81-3a3f-ad2049536e10/
color="light green"

I created an event for each one today. In interactive mode I see

image

but in calendar mode I see

image

You can see when I use the word as the value it's fine, but the RGB provided values don't seem to work.

PartialDragster avatar Dec 01 '22 04:12 PartialDragster

In case it matters this is happening in urxvt version 9.22

PartialDragster avatar Dec 01 '22 04:12 PartialDragster

At least on mac os x, I cannot reproduce this behavior image

geier avatar Jun 03 '23 21:06 geier

can you test what the output of the following is in your terminal?

echo "\x1b[38;2;0;0;255m14:30-15:30 text\x1b[0m\x1b[0m
\x1b[38;2;255;0;0m23:00-24:00 test\x1b[0m\x1b[0m
\x1b[38;2;0;255;0m23:00-24:00 test\x1b[0m\x1b[0m"

I get the following on iterm on mac os image

(but it also doesn't work with Apple's terminal).

geier avatar Jun 03 '23 21:06 geier

Hi geier, thanks for getting back to me.

For that command I had to add -e to enable backslash interpretation. The result was still no colouring though:

image

I did some googling and I came across a few pages that said urxvt doesn't support the 38;2 codes, but other pages that say that it does, so not sure what to make of that.

PartialDragster avatar Jun 05 '23 02:06 PartialDragster

Sorry didn't mean to close it, misclick :/

PartialDragster avatar Jun 05 '23 02:06 PartialDragster