Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection characters are omitted #1368

Open
a-kenji opened this issue May 2, 2022 · 12 comments
Open

Selection characters are omitted #1368

a-kenji opened this issue May 2, 2022 · 12 comments

Comments

@a-kenji
Copy link
Contributor

a-kenji commented May 2, 2022

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
Copy link
Member

imsnif commented May 2, 2022

What do you mean by "selection characters"?

@a-kenji
Copy link
Contributor Author

a-kenji commented May 2, 2022

I update the issue with a screenshot.

@tlinford
Copy link
Contributor

tlinford commented May 2, 2022

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

@a-kenji
Copy link
Contributor Author

a-kenji commented May 2, 2022

@tlinford,
Yes, exactly!

@tlinford
Copy link
Contributor

tlinford commented May 2, 2022

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

@a-kenji
Copy link
Contributor Author

a-kenji commented May 2, 2022

@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
Copy link
Contributor

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
Copy link

BeLeap commented Aug 24, 2022

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
Copy link
Contributor

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

@tlinford
Copy link
Contributor

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
Copy link
Member

imsnif commented Aug 25, 2022

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants