microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95k stars 8.22k forks source link

👁🍬 Smooth cursor animation/transition when moving #9221

Open ApplicationDeveloper opened 3 years ago

ApplicationDeveloper commented 3 years ago

Description of the new feature/enhancement

Cursor should transition pixel-wise within a specified amount of milliseconds from one point to the other, whether by typing or clicking to a new position/cell on the viewport.

Proposed technical implementation details (optional)

Preferably user customizable in terminal profile settings. { ..., smoothCursorTransitionDuration: 90 } or smoothCursorTransition: true or false perhaps.

Examples

word cursoran cur

zadjii-msft commented 3 years ago

Alright so this does look fairly slick. I have no idea how it would work with our current renderer engine. Currently, the cursor is only ever at one specific cell or another. Additionally, the renderer doesn't actually paint at 60fps, it paints when something has actually changed, at a maximum of 60 fps. So we'd need some way of virtually painting the cursor some fraction of the way between the old position and the new one, and then also immediately requesting new frames while the cursor is animating between positions.

Maybe this is something that could be done in an extension? But even then the extension would need to control where the cursor is drawn on a per-pixel basis, not just per-cell. And it would need to hop into the right place in the paint frame, to make sure it's still layered correctly. So maybe this would be really hard to do as an extension.

I'll tag it up regardless. It's a cool idea.

PaulAndreiTaranu commented 3 years ago

I love the smooth cursor caret in VSCode please put it on the terminal !!!

sametaylak commented 2 years ago

Yeah, that would be sick!