zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.54k stars 637 forks source link

Selection characters are omitted #1368

Open a-kenji opened 2 years ago

a-kenji commented 2 years ago

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]
imsnif commented 2 years ago

What do you mean by "selection characters"?

a-kenji commented 2 years ago

I update the issue with a screenshot.

tlinford commented 2 years ago

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

a-kenji commented 2 years ago

@tlinford, Yes, exactly!

tlinford commented 2 years ago

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

a-kenji commented 2 years ago

@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.

tranzystorekk commented 2 years ago

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]
BeLeap commented 2 years ago

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.

tranzystorekk commented 2 years ago

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

tlinford commented 2 years ago

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 )

imsnif commented 2 years ago

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?

tlinford commented 2 years ago

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.