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

Expose hollow-block in DECSCUSR #8353

Open
rockorager opened this issue Feb 19, 2025 · 5 comments
Open

Expose hollow-block in DECSCUSR #8353

rockorager opened this issue Feb 19, 2025 · 5 comments

Comments

@rockorager
Copy link
Contributor

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

Describe the solution you'd like
Extend the DECSCUSR enum to include

...
7 = blinking hollow block
8 = hollow block

Describe alternatives you've considered
None.

Additional context
@dnkl is investigating extending the DECSCUSR enum to include blinking hollow block, and hollow block. Kitty currently allows setting the unfocused shape as hollow, but not the focused shape - nor is it available for TUI applications to set explicitly.

In kitty's case, I think this should also be exposed as a configuration option for cursor_shape (I don't know why anyone would use this...but if it's available in DECSCUSR may as well make it available to users).

foot pr adding configuration option
ghostty discussion

@kovidgoyal
Copy link
Owner

Yes, I have reserved hollow as the shape for unfocused cursors. I don't
think I want to encourage TUI apps to start using this shape. For a
multiplexing terminal like kitty it is particularly important to have
multiple focus indicators to make it easy for users to know when a
window is focused or not. What's the use case for hollow cursors in TUI
apps? Do you know of any actual app that wants to use this?

@rockorager
Copy link
Contributor Author

rockorager commented Feb 19, 2025

I don't know of anyone asking for this, but I do know a couple use cases where I would find it helpful. Mostly in floating windows which have a pick list and an input field. For example, fzf could have a modal option which allows "focusing" the pick list, enabling vim style navigation, but keeping the "cursor" shown in the input box as "unfocused".

Here, the input is focused and my keyboard input goes there.
Image

But you could imagine a world where I "unfocus" that and focus the list instead, where vim bindings "just work"

Image

This particular situation happens a lot in TUI's, so I think it could be a valuable pattern to follow.

@kovidgoyal
Copy link
Owner

Why not just hide the cursor in that case if it's unfocused?

@rockorager
Copy link
Contributor Author

Why not just hide the cursor in that case if it's unfocused?

That would work, and is the accepted pattern - yet kitty (and basically every other terminal) don't do this and instead render a hollow block cursor to indicate loss of input focus. I think that pattern is valuable within a TUI as well.

@kovidgoyal
Copy link
Owner

kovidgoyal commented Feb 19, 2025 via email

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

No branches or pull requests

2 participants