Hacker News new | ask | show | jobs
by Quot 864 days ago
If I had to guess, it's because terminals don't know what a cursor is. From the terminal's perspective, it is just told to print a solid blinking block at a certain location. Neovide knows what the cursor is because it is communicating directly with Neovim.

A terminal could do this, but there would need to be direct integration into Bash, ZSH, etc.

3 comments

Terminals do have a concept of a cursor (there are dedicated control sequences for cursor management). There's no fundamental reason a terminal emulator couldn't implement an animated cursor like this, my guess as to why no one has done it is simply that it's not a very commonly requested feature.
Another problem is that the cursor moves while the screen is buffer is being rendered. The location is only really known once the cursor settles in the same place for some time, which is unacceptable in terms of latency.

The synchronized output extension could be used to do this, though. https://github.com/contour-terminal/contour/blob/master/docs...

You're right! That's pretty neat. I always thought terminal emulators were just simple text displays.

It looks like Wezterm even has preferences for how cursors are displayed.

https://wezfurlong.org/wezterm/config/lua/config/cursor_blin...

Yeah true, maybe could be done with heuristics though - in nearly every case, there's only one single blinking block, which is the cursor. However, not everyone has their cursor configured to blink, and there are cases where there are other blinking blocks. Not sure how to deal with that...
If what you’re saying is true, how do terminals have options to customize the cursor shape?