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

Colour inversion for terminal cursor #526

Closed
Utkarsh-khambra opened this issue Dec 4, 2021 · 5 comments · Fixed by #527
Closed

Colour inversion for terminal cursor #526

Utkarsh-khambra opened this issue Dec 4, 2021 · 5 comments · Fixed by #527
Labels
frontend Contour Terminal Emulator (GUI frontend) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library

Comments

@Utkarsh-khambra
Copy link
Collaborator

Abstract

When cursor shape is block and cursor is moved over to some character then cursor completely hides the character making it unreadable.
Currently this happens in contour
Screenshot from 2021-12-04 13-09-29
and this is in alacritty
Screenshot_2021-12-04_13-13

Motivation

Whenever cursor is moved to some character, the background cell color and text color can be inverted. Alacritty also does this by allowing to set

  cursor:
    text: CellBackground
    cursor: CellForeground

in config file

Specification

@christianparpart
Copy link
Member

Oh yes, let me fix that ASAP. thanks for pushing me. :-)

@christianparpart christianparpart added frontend Contour Terminal Emulator (GUI frontend) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library labels Dec 4, 2021
@Utkarsh-khambra
Copy link
Collaborator Author

Thanks :-)

@christianparpart
Copy link
Member

  cursor:
    text: CellBackground
    cursor: CellForeground

I really struggled in accepting the naming scheme of Alacritty, as much as I tried to be in line with their naming scheme to not confuse users, but cursor.cursor doesn't sound quite right. I'm not saying I found the best solution though, but here we go. (PR should be merged soon).

christianparpart added a commit that referenced this issue Dec 5, 2021
Improves text cursor rendering and extends cursor configuration accordingly (#526).
@christianparpart
Copy link
Member

@Utkarsh-khambra this is how you can configure it:

# Mandates the color of the cursor and potentially overridden text.
#
# The color can be specified in RGB as usual, plus
# - CellForeground: Selects the cell's foreground color.
# - CellBackground: Selects the cell's background color.
cursor:
# Specifies the color to be used for the actual cursor shape.
#
# Default: CellForeground
default: CellForeground
# Specifies the color to be used for the characters that would
# be covered otherwise.
#
# Default: CellBackground
text: CellBackground

While now being merged to master, CI should have created binary packages already also. Otherwise, I think it's time to make another point release. Enjoy.

@Utkarsh-khambra
Copy link
Collaborator Author

Thanks it works great now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Contour Terminal Emulator (GUI frontend) VT: rasterizer Rendering of the terminal into a pixmap using `terminal_renderer` library
Projects
None yet
2 participants