-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(term): enable native cursor rendering #14951
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
base: master
Are you sure you want to change the base?
Conversation
This replaces the manually rendered block cursor with the native terminal cursor. This change allows users to leverage terminal capabilities such as cursor blinking, distinct shapes, and visual effects (e.g., cursor trails). Note: This behavior is applied only when a single cursor is active; multiple cursors are still rendered via cell inversion. Fixes helix-editor#12642
|
I have been using this feature for the last two weeks and haven't found any problems—it works like a charm! I'm currently using Ghostty with shaders enabled, and having the native cursor support makes working in Helix so much more enjoyable. |
|
How is it different to #13821 ? |
|
On my initial search I didn't find this pull request due to the different description. After checking the applied changes, I'm not sure if we're achieving the same result. In particular, #13821 adds more complexity with its prompt option. That complexity may be required, but up to this point I haven't found a reason for it in my testing. |
|
See #13821 (comment) |
|
I just updated the code, to allow the user to control the behavior via the config. [editor.cursor-shape]
insert = "bar"
normal = "native"
select = "underline" |
|
Some terminals support multiple native cursors for a while now. E.g. Kitty and probably some others as well. Which basically means soon every terminal will follow the suit, same as with image support protocols. Can the more-than-one-cursor fake cursor logic check the term capabilities and use multiple native cursors when available? |
|
While native multi-cursor support is definitely the future, I think we still need the manual rendering logic for now. Helix aims to support all terminals, and I'm skeptical that the wider ecosystem will adopt the Kitty protocol anytime soon. Also, regarding the implementation—I'm not exactly sure how to check for that capability here. It feels like something that should be abstracted away by helix terminal backend/dependency. |
Kitty specifically proposed that as an open multi cursor standard, not a Kitty only protocol. Which is why I think many other terminals will pick it up too. There is just no standards body deciding on these terminal protocols so it is pretty much whoever comes first. It was the case with inline images and I bet built-in multiplexing is the next in line. Both Kitty and WezTerm already support built-in multiplexing so I think the days of tmux are numbered... Interestingly Ghostty appears to support multi-cursors too. That's two popular terminals already. Also I have just discovered this helix multi-cursor support PR here: 14757 |
|
This PR made me realise how terrible my cursor color is Also about the PR description, as far as I know, Wezterm lets you customise the cursor, but for now, there is no support for cursor trails, aside from a recent pull request wezterm/wezterm#7420 |
|
I'm sorry for the late response, I was pretty busy. I just verified your described bug and fixed it. @NSPC911 Could you please verify, if it is working for you know? |
I had the same issue. For me your fix is working. Thank you! |



Summary
This PR changes the cursor rendering behavior to use the terminal's native cursor APIs instead of a software-rendered block for the primary cursor.
Rationale
Previously, Helix rendered the block cursor by manually inverting the cell colors. While consistent, this prevents the terminal emulator from applying its own cursor effects, such as:
Implementation
Fixes #12642