[PR #15969] WIP: Move timers from TermControl to Core/Interactivity #30789

Open
opened 2026-01-31 09:42:57 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15969

State: closed
Merged: No


This WIP PR moves the blink and cursor timers down to Core (where it has unfettered access to everything it needs).

It also puts Core in charge of displaying the cursor when there is input, and managing the cursor's focus visibility.

It also means that Core no longer needs a "BlinkCursor" method?

This PR will allow us to remove the timer from the WPF layer as well.

This PR also moves the autoscroll timer down into ControlInteractivity (!)
which means that all interactivity consumers get it for free. That's RAD.

All the logic is the same.

I also took the opportunity to remove some silly parts of the ControlInteractivity API that supported this, like it needing to be told whether the pointer was pressed while it was inside the box and whether it is focused (???)

Now it darn well keeps track of those things itself.

TODO:

  • Fix "allow cursor while blurred"
  • Fix a crash I observed trying to blink a nonexistent text buffer
    cursor ??? while splitting a bunch of panes all at once
  • Test more
  • Make the ControlInteractivityUnitTests pass (!)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15969 **State:** closed **Merged:** No --- This WIP PR moves the blink and cursor timers down to Core (where it has unfettered access to everything it needs). It also puts Core in charge of displaying the cursor when there is input, and managing the cursor's focus visibility. It also means that Core no longer needs a "BlinkCursor" method? This PR will allow us to remove the timer from the WPF layer as well. This PR also moves the _autoscroll_ timer down into ControlInteractivity (!) which means that all interactivity consumers get it for free. That's **RAD**. All the logic is the same. I also took the opportunity to remove some silly parts of the ControlInteractivity API that supported this, like it needing to be told whether the pointer was pressed while it was inside the box _and whether it is focused_ (???) Now it darn well keeps track of those things itself. TODO: - [ ] Fix "allow cursor while blurred" - [ ] Fix a crash I observed trying to blink a nonexistent text buffer cursor ??? while splitting a bunch of panes all at once - [ ] Test more - [ ] Make the ControlInteractivityUnitTests pass (!)
claunia added the pull-request label 2026-01-31 09:42:57 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30789