Skip to content

selection highlighting: allow styles (reverse mode) #646

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

Closed
blueyed opened this issue Jun 16, 2018 · 4 comments
Closed

selection highlighting: allow styles (reverse mode) #646

blueyed opened this issue Jun 16, 2018 · 4 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Jun 16, 2018

Currently you can define selection_foreground and selection_background to configure the display of selected text.

I would like to be able to display it "inversed" (in "reverse" mode), which could be achieved by a new selection_style setting, and the following config:

selection_foreground = None
selection_background = None
selection_style = reverse

selection_style should accept a list then, so that selection_style = reverse,underline would also work.

This would make it work seamlessly with different color themes (light and dark).

btw: is it possible already to change options for the current kitty instance? This could be used to dynamically change the selection fg/bg settings then when switching color profiles.
I know that there are a few nice xterm protocol extensions already, but this does not seem to be among them.

@kovidgoyal
Copy link
Owner

I personally hate reverse video for selections, so I am not interested in implementing this, but patches for an option are welcome. You can simply use a color pair that works with both light and dark color schemes, like say, medium blue with white or black text. Or change the selection colors with your theme.

And see the kitty FAQ for how to change all colors in running kitty instances. There do exist escape codes to do it, but you can do much more using the kitty remote control facility.

@jsomedon
Copy link

jsomedon commented Nov 7, 2018

Selection with reversed fore-background color let your code syntax highlighted even when you select them. I guess users want this feature mainly for this reason.. Would be really beneficial if you bring this feature in.
---EDIT
If, like you said, you don't plan to implement this feature anytime soon but accept pull request, I am willing to work on this. Would be helpful if you point out which code to look at.

@page-down
Copy link
Contributor

I tried the latest selection reverse video feature and found that the text color seems to be the same as the background color.

Setting both of these to none will cause a "reverse video" effect for selections ...

kitty --config=NONE -o selection_foreground=none -o selection_background=none

Can be reproduced under macOS and Linux.

@kovidgoyal
Copy link
Owner

2d66e37

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

No branches or pull requests

4 participants