zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Selection characters are omitted

Open a-kenji opened this issue 3 years ago • 12 comments

Basic information

zellij --version: 0.29.0 uname -av: Linux 5.17.3 #1-NixOS SMP PREEMPT Wed Apr 13 17:27:43 UTC 2022 x86_64 GNU/Linux alacritty : alacritty 0.10.1 ()

When selecting text with a mouse, it is correctly copied, but the selection characters are omitted.

image

This is an example from outside of zellij. These characters are not displayed inside of zellij, while selecting.

This seems theme related, the theme I use:

    bg: [44, 46, 52]
    fg: [197, 205, 217]
    black: [62, 66, 73]
    gray: [62, 66, 73]
    red: [218, 185,255]
    green: [255, 146, 208]
    yellow: [222, 185, 116]
    blue: [108, 82, 235]
    magenta: [255, 146, 208]
    cyan: [44, 46, 52]
    white: [185, 255, 218]
    orange: [255, 146, 208]

a-kenji avatar May 02 '22 19:05 a-kenji

What do you mean by "selection characters"?

imsnif avatar May 02 '22 19:05 imsnif

I update the issue with a screenshot.

a-kenji avatar May 02 '22 19:05 a-kenji

Do you mean that the selection doesn't become highlighted?

tlinford avatar May 02 '22 19:05 tlinford

@tlinford, Yes, exactly!

a-kenji avatar May 02 '22 19:05 a-kenji

Hmm, working alright for me. Maybe something theme/color related?

tlinford avatar May 02 '22 19:05 tlinford

@tlinford, You are right, it is theme/color related. Weird. The colors in my config didn't change at all. I'll update the issue with the theme.

a-kenji avatar May 02 '22 19:05 a-kenji

Same on 0.31.3 with the dracula theme:

themes:
  dracula:
    fg: [248, 248, 242]
    bg: [40, 42, 54]
    black: [0, 0, 0]
    gray: [68, 71, 90]
    red: [255, 85, 85]
    green: [80, 250, 123]
    yellow: [241, 250, 140]
    blue: [98, 114, 164]
    magenta: [255, 121, 198]
    cyan: [139, 233, 253]
    white: [255, 255, 255]
    orange: [255, 184, 108]

tranzystorekk avatar Aug 23 '22 21:08 tranzystorekk

Changing bg to a different color worked for me.

theme: gruvbox-dark

themes:
  gruvbox-dark:
    bg: [10, 10, 10] # Originally, bg: [40, 40, 40]
    red: [204, 36, 29]
    green: [152, 151, 26]
    yellow: [215, 153, 33]
    blue: [69, 133, 136]
    magenta: [177, 98, 134]
    orange: [214, 93, 14]
    fg: [213, 196, 161]
    cyan: [104, 157, 106]
    black: [60, 56, 54]
    white: [251, 241, 199]

스크린샷 2022-08-25 오전 8 36 00

Maybe we should update example theme configurations.

BeLeap avatar Aug 24 '22 23:08 BeLeap

We could probably use an entirely separate theme color setting for "selection background"

tranzystorekk avatar Aug 24 '22 23:08 tranzystorekk

As was talked about in discord, this happens when the theme's bg matches the terminal emulator's background color. Basically the selection gets drawn the same color as the existing background and is not visiible.

We could probably use an entirely separate theme color setting for "selection background"

I agree, it may be worth waiting for the upcoming kdl config changes to land first though. (cc @imsnif )

tlinford avatar Aug 25 '22 07:08 tlinford

So, right now the themes work as mapping from one color to another a la classic terminal themes. While I'm open to having a conversation to change this to refer to specific UI elements (with all the complexity of custom UIs that will bring), I'm a little hesitant to start mixing these approaches. (eg. by adding a selectionBackground). I'm afraid this will slowly bring us toward the second approach without proper planning or backwards compatibility.

That being said: I'm not sure I understand why the selection uses the theme background. Wouldn't that by definition create this problem for every theme that uses the background?

imsnif avatar Aug 25 '22 12:08 imsnif

That being said: I'm not sure I understand why the selection uses the theme background.

Me neither, but I'm also confused because I couldn't really find it being used for anything else. In any case, with the current theme we have the only other option would be to use one of the defined colors?

Wouldn't that by definition create this problem for every theme that uses the background?

no, it only happens if the theme's background is set to the same color as the terminal emulator's background. I was finally able to reproduce in alacritty by setting it's colors.primary.background to the same value as theme.bg in zellij.

tlinford avatar Aug 25 '22 15:08 tlinford