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

Feature Request: Swapping the foreground color and the background color #706

Closed
zhou13 opened this issue Apr 19, 2021 · 10 comments
Closed
Labels
enhancement New feature or request fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.

Comments

@zhou13
Copy link

zhou13 commented Apr 19, 2021

Is your feature request related to a problem? Please describe.
Many terminals support to swap the fg and bg color as the color under the cursor. However, I search through the document and I cannot find an example of this feature. Such a method is better than hardcode the cursor color as it is able to reflect the original color under the cursor.

Describe the solution you'd like
In alacritty, I am able to configure like this:

  cursor:
    text: CellBackground
    cursor: CellForeground

In wezterm, I hope I will be able to do things like

return {
  colors = {
      cursor_bg = "fg",
      cursor_fg = "bg",
  }
}

Describe alternatives you've considered
N./A.
Additional context
N./A.

@zhou13 zhou13 added the enhancement New feature or request label Apr 19, 2021
@zhou13 zhou13 changed the title Feature request: Swapping the foreground color and the background color Feature Request: Swapping the foreground color and the background color Apr 19, 2021
@wez
Copy link
Owner

wez commented Apr 24, 2021

Are you looking specifically for the ability to configure colors in terms of the foreground/background, or would you be satisfied with a separate option that overrides the cursor color setting and forces it into reverse video mode?

@zhou13
Copy link
Author

zhou13 commented Apr 25, 2021

It would be the latter one, as in the reverse video mode.

wez added a commit that referenced this issue Apr 25, 2021
@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label Apr 25, 2021
@wez
Copy link
Owner

wez commented Apr 25, 2021

in the next nightly build (in about 20-30 mins), you can set force_reverse_video_cursor = true

@wez wez closed this as completed Apr 25, 2021
@zhou13
Copy link
Author

zhou13 commented Jun 21, 2021

It seems that force_reverse_video_cursor = true no longer works for me: the cursor color still applies.

@wez
Copy link
Owner

wez commented Jun 23, 2021

It works for me with a quick test here; could you open a new bug issue with all the information needed to reproduce the issue?

@zhou13
Copy link
Author

zhou13 commented Jun 23, 2021

I take a look at the code and I think there is some misunderstanding. When the setting is enabled, it simply uses palette.background to replace palette.cursor_fg. This is not useful, as I can directly set palette.cursor_fg to be the color in palette.background. The intended results should be swaping the fg and bg color of the character under the cursor, rather than choosing from a predetermined palette.

Alacritty result:
image

wezterm result:
image

@AtifChy
Copy link

AtifChy commented Jun 28, 2021

@zhou13 how do you enable dynamic cursor color on wezterm?

@wez
Copy link
Owner

wez commented Jun 28, 2021

I just pushed a fix for this; it should show up in the nightly builds in ~30 minutes.

@AtifChy https://wezfurlong.org/wezterm/config/lua/config/force_reverse_video_cursor.html

@zhou13
Copy link
Author

zhou13 commented Jun 28, 2021

Looks like it works correctly. Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.
Projects
None yet
Development

No branches or pull requests

3 participants