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

Reversal of reverse video for cursor #408

Closed
jonhoo opened this issue Feb 12, 2017 · 11 comments
Closed

Reversal of reverse video for cursor #408

jonhoo opened this issue Feb 12, 2017 · 11 comments

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Feb 12, 2017

alacritty's default behavior is to reverse the foreground and background colors for the current cursor (unless custom_cursor_colors is set). This usually works quite well, except in the case where the cursor is over a character that is already reversed. Consider, for example, the case where you are highlighting text in tmux (^[, move to some text, v to visually highlight). tmux will reverse all selected characters (including the current cursors position). alacritty will then reverse the color again. Depending on your particular color configuration, the cursor essentially disappears. If the highlight also changes the background color, the net effect is just that the font color of the character under the cursor changes, but this is still not particularly visible.

I'm not entirely sure how this would be fixed though? Can alacritty somehow detect that it is reversing a reversal?

@impowski
Copy link

impowski commented Feb 12, 2017

There is a flag INVERSE and if something is already inversed you can swap fg and bg. I'd advice you to give a real example with some screenshots and post in in #349 and I'll take a look on it.

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 12, 2017

@impowski I'm not sure I understand what you mean by "There is a flag INVERSE"? Is this a command-line flag for alacritty (I can't find it in alacritty --help)? Or a config flag (I don't see it in the included alacritty.yml file)? As far as I can tell, #349 isn't merged yet, so since I'm running with a build off of master, I don't know how that affects the behavior. If you tell me what config to try with #349, I'd be happy to build that and try.

The example I give in the issue description above is a "real" example. The net result is:
2017-02-12-161439_3840x1080_scrot
Note that the selection spans from h to h, but the last h is "double reversed", and thus hard to distinguish.

@impowski
Copy link

impowski commented Feb 12, 2017

@jonhoo Yeah, I know about this problem, as I remember I fixed it in my PR. INVERSE I mean in code, there is a different flags on Cell which can be applied to implement inverse and other things.

There is no special config in my PR, I only added cursor_style variable which can be set to Block, Beam and Underline. And you will need to play around with cursor colors, and for selection I just take out a foreground of the grid as I remember and I don't swap cursor color at all.

Can you give me your colors from config, and I will check it tomorrow? Because there was one bug on master with custom colors and was reported in my PR, and since then I didn't update anything on my branch. So tomorrow I'll definitely will update everything and check with my changes.

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 12, 2017

Ah, I see. I still haven't tried building with your PR. Would it be helpful if I did?

My color config is

custom_cursor_colors: false

# Colors (Base16 Atelier Dune)
colors:
  # Default colors
  primary:
    background: '0x20201d'
    foreground: '0xa6a28c'

  # Colors the cursor will use if `custom_cursor_colors` is true
  cursor:
    background: '0xffffff'
    foreground: '0x000000'

  # Normal colors
  normal:
    black:   '0x20201d'
    red:     '0xd73737'
    green:   '0x60ac39'
    yellow:  '0xae9513'
    blue:    '0x6684e1'
    magenta: '0xb854d4'
    cyan:    '0x1fad83'
    white:   '0xa6a28c'

  # Bright colors
  bright:
    black:   '0x7d7a68'
    red:     '0xd73737'
    green:   '0x60ac39'
    yellow:  '0xae9513'
    blue:    '0x6684e1'
    magenta: '0xb854d4'
    cyan:    '0x1fad83'
    white:   '0xfefbec'

However, I then source this file which uses escape codes to set the colors (including some beyond the initial 16).

@impowski
Copy link

@jonhoo
screenshot from 2017-02-13 01-44-08

So here as you can see it's from o to j.

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 12, 2017

That's the behavior with your PR? If so, I'm happy :p

@impowski
Copy link

@jonhoo yeah it is. I'm glad. 😄

@impowski
Copy link

@jonhoo I update my PR to a recent changes, everything should be the same.

@moon-chilled
Copy link

I'm pretty sure that's the desired behaviour. That's how it is in all other terminals.

@jwilm
Copy link
Contributor

jwilm commented Jul 1, 2017

Is this still a problem?

@chrisduerr
Copy link
Member

I believe this has been resolved, since we now check for INVERSE or cursor to inverse the cell content.

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

No branches or pull requests

5 participants