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

Allow customizing (and animating) the text cursor appearance #1432

Open
eugenesvk opened this issue Dec 20, 2021 · 7 comments
Open

Allow customizing (and animating) the text cursor appearance #1432

eugenesvk opened this issue Dec 20, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@eugenesvk
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I like the Bar cursor style instead of the Block one, but it's a bit too narrow, so visibility suffers more than it should

Describe the solution you'd like

A configuration option that would allow me to change the width of a Bar cursor

Describe alternatives you've considered
Going back to the Block

Additional context

@eugenesvk eugenesvk added the enhancement New feature or request label Dec 20, 2021
@wez
Copy link
Owner

wez commented Dec 21, 2021

I'm not excited to add a very specific configuration option for this, because I think it would, over time as more options are added, make the implementation more complex and harder to change without breaking someone's carefully crafted config on an upgrade.

I've been considering exposing the custom block glyph styling datatypes to lua to allow for defining frames in animated cursors and I think that same mechanism could be used here for this; while it is a more complex configuration than just adding a width control, the overall result would simplify the logic for selecting a cursor shape and make a very powerful configuration for end users.

I don't know exactly what this would look like yet, but the general requirements are:

  • Ability to override the possible cursor shapes individually. eg: do all of the below one way for SteadyBlock and a different way for SteadyBar and so on.
  • Ability to specify either:
    • an image file to use for the shape
    • use the same set of drawing commands used for internal custom glyphs
  • For animations:
    • If using animated gif/png then simply use those frames and timing info
    • Otherwise, ability to specify multiple frames (eg: discrete image files, or discrete drawing commands per frame), as well as the frame delay
  • For inactive/unfocused display:
    • Specify a single frame to use
    • Consider adding a color scheme option for the inactive cursor color

@wez wez changed the title Allow changing Bar cursor's width Allow customizing (and animating) the text cursor appearance Dec 21, 2021
wez added a commit that referenced this issue Dec 22, 2021
Remove special case for blocks where we switched it out for a blank
sprite and instead varied the cell background.

We now always render a matching cursor sprite as a separate layer
over the top of the text background color, but below the text
foreground layer.

This is preparing for #1432

Make bar/line cursors use the text foreground color when reverse
video cursors are enabled, per @VKondakoff:
#1076 (comment)
wez added a commit that referenced this issue Dec 23, 2021
Don't want it to be the block outline

refs: #1432
@ghost
Copy link

ghost commented Dec 25, 2021

OSC 22 is supported by several terminals for the application to select a cursor. I have not yet looked into it deeply, but apparently xterm and mintty at least do not agree on what those cursors should be.

If this feature is implemented, one might also get OSC 22 for nearly free.

@bertin0
Copy link

bertin0 commented Jun 6, 2023

Consider adding a color scheme option for the inactive cursor color

So at the moment how is the inactive cursor color chosen? Is it hardcoded? Is it linked to any other color in the color scheme?

@wez
Copy link
Owner

wez commented Jun 6, 2023

There is currently no distinction for color based on the active pane. The shape does change to an outline shape when inactive.

@bertin0
Copy link

bertin0 commented Jun 6, 2023

Sorry, I meant to say focus as in the window being clicked on or not. For me, in that case, the cursor hollows out and turns green instead of white/gray-ish as I set it in both cursor_fg and cursor_bg

@wez
Copy link
Owner

wez commented Jun 6, 2023

@bertin0
Copy link

bertin0 commented Jun 6, 2023

Look for cursor_border in https://wezfurlong.org/wezterm/config/appearance.html#defining-your-own-colors

Ah thanks that makes total sense, stupid me

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

No branches or pull requests

3 participants