-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Discussed in #10981
Originally posted by Koranir February 24, 2026
https://github.com/user-attachments/assets/002b7b73-4ea1-43f4-851e-d9598713456d
In the above video I have a cursor trail effect enabled, which should mark a change in position of the cursor visually. However, with the way current/previous cursor positions are handled, the trail often appears in useless ways --- for example, when the yes | head -n 15 command is run the trail appears to go from the start of the shell prompt to the input, despite the whole of the output and prompt appearing pretty much instantly.
I think a better solution would be to debounce the cursor position until it's been stable for a while, and only then trigger change the current and old cursor positions.
An additional problem is that when the command is input at the bottom of the screen, the output and new shell prompt are automatically scrolled into view but the previous cursor position isn't actually scrolled with it, making the trail come from thin air.
The cursor's previous position should also be scrolled along with it.
I've made a few hacky edits to ghostty that implement these changes at https://github.com/Koranir/ghostty/tree/shader-cursor-adjustments, so here's a video:
2026-02-24.19-02-39.mp4
This just uses a 10ms debounce, which I think adds a 10ms delay to rendering the cursor position (input itself is unchanged), which could be avoided by only updating the previous cursor position maybe?