[GH-ISSUE #611] feat: custom cursor styles #932

Closed
opened 2026-03-14 09:04:47 +03:00 by kerem · 5 comments
Owner

Originally created by @m4saurabh on GitHub (Feb 1, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/611

I saw something very cool recently and was wondering can we get it inside opentui.

Cursor styles on hover.
The TUI shown in the video is ampcode.

https://github.com/user-attachments/assets/16f27d6e-6813-4aa5-aa87-ac952491ceae

Originally created by @m4saurabh on GitHub (Feb 1, 2026). Original GitHub issue: https://github.com/anomalyco/opentui/issues/611 I saw something very cool recently and was wondering can we get it inside opentui. Cursor styles on hover. The TUI shown in the video is ampcode. https://github.com/user-attachments/assets/16f27d6e-6813-4aa5-aa87-ac952491ceae
kerem 2026-03-14 09:04:47 +03:00
Author
Owner

@kommander commented on GitHub (Feb 2, 2026):

Sure, why not.

<!-- gh-comment-id:3832536232 --> @kommander commented on GitHub (Feb 2, 2026): Sure, why not.
Author
Owner

@viralcodex commented on GitHub (Feb 4, 2026):

Hi, is there any chance I can explore this and maybe contribute on this? Would love to do it.
Thanks

<!-- gh-comment-id:3847934422 --> @viralcodex commented on GitHub (Feb 4, 2026): Hi, is there any chance I can explore this and maybe contribute on this? Would love to do it. Thanks
Author
Owner

@viralcodex commented on GitHub (Feb 11, 2026):

Hi @kommander @simonklee , I was reading and searching about it, and got to know that many native CLI don't support cursor hover styles natively. Umm, I do have some implementation written but I would like to know if I can do it or how you guys expect it to work?
Currently I am doing a similar impl as the CursorStyle with mouseOut and mouseOver events within recheckHoverState().

<!-- gh-comment-id:3883519700 --> @viralcodex commented on GitHub (Feb 11, 2026): Hi @kommander @simonklee , I was reading and searching about it, and got to know that many native CLI don't support cursor hover styles natively. Umm, I do have some implementation written but I would like to know if I can do it or how you guys expect it to work? Currently I am doing a similar impl as the CursorStyle with mouseOut and mouseOver events within recheckHoverState().
Author
Owner

@kommander commented on GitHub (Feb 11, 2026):

Hi @viralcodex it cannot be guaranteed to work in all terminal emulators, but that's fine, many features depend on the terminal.

If there is a way to detect support, it would be good to add it to terminal.zig capabilities.

There are methods to setCursorStyle on the renderer, I would probably add the option there.

It needs to make sure it is properly reset in the shutdown sequence in terminal.zig if not already done with the current cursor reset.

<!-- gh-comment-id:3884378901 --> @kommander commented on GitHub (Feb 11, 2026): Hi @viralcodex it cannot be guaranteed to work in all terminal emulators, but that's fine, many features depend on the terminal. If there is a way to detect support, it would be good to add it to `terminal.zig` capabilities. There are methods to `setCursorStyle` on the renderer, I would probably add the option there. It needs to make sure it is properly reset in the shutdown sequence in `terminal.zig` if not already done with the current cursor reset.
Author
Owner

@viralcodex commented on GitHub (Feb 11, 2026):

Hi @kommander, thanks for clarifying. Yeah I started from there it felt better to have a separate MouseHoverStyles using OSC 22 Escape Characters, not only pointer but also blocked/busy state as well.
Sure, will look into it if it is feasible to extend in the current cursor implementation and raise a PR. If anything is needed to be changed, will update accordingly in review

<!-- gh-comment-id:3884528975 --> @viralcodex commented on GitHub (Feb 11, 2026): Hi @kommander, thanks for clarifying. Yeah I started from there it felt better to have a separate MouseHoverStyles using OSC 22 Escape Characters, not only pointer but also blocked/busy state as well. Sure, will look into it if it is feasible to extend in the current cursor implementation and raise a PR. If anything is needed to be changed, will update accordingly in review
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#932
No description provided.