mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[PR #794] [MERGED] fix: preserve terminal's native cursor style by default #1570
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#1570
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/anomalyco/opentui/pull/794
Author: @aarcamp
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/9/2026
Merged by: @kommander
Base:
main← Head:cursor-style-default📝 Commits (3)
86a2256fix: preserve terminal's native cursor style by default4c83304test: add cursor default regressionb4bee91documentation📊 Changes
8 files changed (+66 additions, -6 deletions)
View changed files
➕
packages/core/src/tests/renderer.cursor.test.ts(+26 -0)📝
packages/core/src/types.ts(+1 -1)📝
packages/core/src/zig.ts(+2 -2)📝
packages/core/src/zig/lib.zig(+3 -2)📝
packages/core/src/zig/renderer.zig(+3 -0)📝
packages/core/src/zig/terminal.zig(+2 -1)📝
packages/core/src/zig/tests/renderer_test.zig(+24 -0)📝
packages/web/src/content/docs/core-concepts/renderer.mdx(+5 -0)📄 Description
The renderer's cursor style defaulted to .block, which emitted \x1b[2 q on every frame — overriding the user's terminal cursor preference (e.g. bar/line) even when no component explicitly set a cursor style. Add a .default variant to CursorStyle that emits \x1b[0 q (the ANSI "reset cursor style" sequence), and make it the initial state. Components that call setCursorPosition() without setCursorStyle() now preserve the terminal's native cursor.
https://github.com/user-attachments/assets/d7e388d7-d7f3-4e92-96ff-fe8e13da3df6
Standalone script used to produce the demo:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.