[PR #676] [MERGED] feat: Added HoverCursorStyle to APIs using OSC 22 #1484

Closed
opened 2026-03-14 09:39:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/676
Author: @viralcodex
Created: 2/12/2026
Status: Merged
Merged: 2/16/2026
Merged by: @kommander

Base: mainHead: hover-cursor-style


📝 Commits (10+)

  • aefcb7c Added HoverCursorStyle to APIs using OSC 22
  • aee4b52 Merge branch 'main' into hover-cursor-style
  • 6e6d3c5 fix(tests): add newline at end of hover-cursor.test.ts
  • 27136ce Merge branch 'hover-cursor-style' of https://github.com/viralcodex/opentui into hover-cursor-style
  • bd1e82b Merge branch 'main' into hover-cursor-style
  • e970ce3 Merge branch 'main' into hover-cursor-style
  • 8bf24ab refactor: removed hoverCursorStyle and updated cursor handling in renderer
  • a737ced refactor: clean up imports and formatting in types and zig files
  • 62a05a7 Merge branch 'main' into hover-cursor-style
  • 16f0117 refactor: remove hover cursor demo example and related functionality

📊 Changes

11 files changed (+232 additions, -58 deletions)

View changed files

📝 packages/core/src/examples/opentui-demo.ts (+1 -1)
📝 packages/core/src/renderables/EditBufferRenderable.ts (+2 -4)
📝 packages/core/src/renderer.ts (+15 -14)
packages/core/src/tests/hover-cursor.test.ts (+98 -0)
📝 packages/core/src/types.ts (+8 -3)
📝 packages/core/src/zig-structs.ts (+15 -0)
📝 packages/core/src/zig.ts (+32 -18)
📝 packages/core/src/zig/ansi.zig (+5 -0)
📝 packages/core/src/zig/lib.zig (+25 -6)
📝 packages/core/src/zig/renderer.zig (+7 -12)
📝 packages/core/src/zig/terminal.zig (+24 -0)

📄 Description

Fixes: #611

Hi @kommander,

Added Custom cursor styles for the openTUI API through MouseCursorStyle.
Includes: pointer, disabled, crosshair, and move.

Used OSC 22 and demo-ed on kitty terminal.

I have added all of them for usage (and future usage) but I can remove them if needed.

Child elements can override the parent hoverCursorStyle.

Also on shutdown the states reset to default cursors (added shutdown code in both native and typescript code)

https://github.com/user-attachments/assets/c877730f-bada-453a-a6ee-a95f82e47bf2

Let me know if changes are needed, will do accordingly.

Thanks :)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/676 **Author:** [@viralcodex](https://github.com/viralcodex) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/16/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `hover-cursor-style` --- ### 📝 Commits (10+) - [`aefcb7c`](https://github.com/anomalyco/opentui/commit/aefcb7ce4d57b5a02bf5a416c0a030120c4f5b3a) Added HoverCursorStyle to APIs using OSC 22 - [`aee4b52`](https://github.com/anomalyco/opentui/commit/aee4b521fe2dbe66ef747eff374b9e8d54576799) Merge branch 'main' into hover-cursor-style - [`6e6d3c5`](https://github.com/anomalyco/opentui/commit/6e6d3c53129531cba41938b2c8dc6bd985a36e36) fix(tests): add newline at end of hover-cursor.test.ts - [`27136ce`](https://github.com/anomalyco/opentui/commit/27136ce6dcf0420c513baba9caf5d8b2b3acffa5) Merge branch 'hover-cursor-style' of https://github.com/viralcodex/opentui into hover-cursor-style - [`bd1e82b`](https://github.com/anomalyco/opentui/commit/bd1e82be9ef70c323ae87682ed317f3a6712e212) Merge branch 'main' into hover-cursor-style - [`e970ce3`](https://github.com/anomalyco/opentui/commit/e970ce331f0c38fe903ef69f6207092719d1db0e) Merge branch 'main' into hover-cursor-style - [`8bf24ab`](https://github.com/anomalyco/opentui/commit/8bf24ab739f34117414a950e73c30b1fb87dd202) refactor: removed hoverCursorStyle and updated cursor handling in renderer - [`a737ced`](https://github.com/anomalyco/opentui/commit/a737ced8f1cac2f79de07e1b897e39690b1b877a) refactor: clean up imports and formatting in types and zig files - [`62a05a7`](https://github.com/anomalyco/opentui/commit/62a05a73102f6dab8432379fed8047785de19163) Merge branch 'main' into hover-cursor-style - [`16f0117`](https://github.com/anomalyco/opentui/commit/16f01173bbb73c57e10cda9c5dad4069fd98b898) refactor: remove hover cursor demo example and related functionality ### 📊 Changes **11 files changed** (+232 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/examples/opentui-demo.ts` (+1 -1) 📝 `packages/core/src/renderables/EditBufferRenderable.ts` (+2 -4) 📝 `packages/core/src/renderer.ts` (+15 -14) ➕ `packages/core/src/tests/hover-cursor.test.ts` (+98 -0) 📝 `packages/core/src/types.ts` (+8 -3) 📝 `packages/core/src/zig-structs.ts` (+15 -0) 📝 `packages/core/src/zig.ts` (+32 -18) 📝 `packages/core/src/zig/ansi.zig` (+5 -0) 📝 `packages/core/src/zig/lib.zig` (+25 -6) 📝 `packages/core/src/zig/renderer.zig` (+7 -12) 📝 `packages/core/src/zig/terminal.zig` (+24 -0) </details> ### 📄 Description Fixes: #611 Hi @kommander, Added Custom cursor styles for the openTUI API through MouseCursorStyle. Includes: pointer, disabled, crosshair, and move. Used OSC 22 and demo-ed on kitty terminal. I have added all of them for usage (and future usage) but I can remove them if needed. Child elements can override the parent hoverCursorStyle. Also on shutdown the states reset to default cursors (added shutdown code in both native and typescript code) https://github.com/user-attachments/assets/c877730f-bada-453a-a6ee-a95f82e47bf2 Let me know if changes are needed, will do accordingly. Thanks :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:39:15 +03:00
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#1484
No description provided.