Search highlights are gone if the window is resized #21535

Closed
opened 2026-01-31 07:47:28 +00:00 by claunia · 7 comments
Owner

Originally created by @carlos-zamora on GitHub (Apr 16, 2024).

v1.20.11072.0 (bug bash on 4/16)

They shouldn't stick around after a resize

Originally created by @carlos-zamora on GitHub (Apr 16, 2024). v1.20.11072.0 (bug bash on 4/16) They shouldn't stick around after a resize
claunia added the Area-OutputIssue-BugNeeds-Tag-FixProduct-Terminal labels 2026-01-31 07:47:28 +00:00
Author
Owner

@tusharsnx commented on GitHub (Apr 19, 2024):

They shouldn't stick around after a resize

Does #16611 fix this for you?

@tusharsnx commented on GitHub (Apr 19, 2024): > They shouldn't stick around after a resize Does #16611 fix this for you?
Author
Owner

@lhecker commented on GitHub (Apr 19, 2024):

I may be doing something wrong, but it seems to still occur.

@lhecker commented on GitHub (Apr 19, 2024): I may be doing something wrong, but it seems to still occur.
Author
Owner

@lhecker commented on GitHub (Apr 19, 2024):

BTW something funny is happening when I resize the app (this is a debug build so it's a little laggy):

https://github.com/microsoft/terminal/assets/2256941/de665325-c0a2-4b2d-bdaf-5a759b5f8652

This is with my changes in to redo the search on resize, but I haven't touched the search code so I think it may have a bug.

@lhecker commented on GitHub (Apr 19, 2024): BTW something funny is happening when I resize the app (this is a debug build so it's a little laggy): https://github.com/microsoft/terminal/assets/2256941/de665325-c0a2-4b2d-bdaf-5a759b5f8652 This is with my changes in to redo the search on resize, but I haven't touched the search code so I think it may have a bug.
Author
Owner

@tusharsnx commented on GitHub (Apr 19, 2024):

If you have already introduced the throttled func, you still need to clear the search at the time of resize otherwise they render relative to the old buffer 🤔

@tusharsnx commented on GitHub (Apr 19, 2024): If you have already introduced the throttled func, you still need to clear the search at the time of resize otherwise they render relative to the old buffer 🤔
Author
Owner

@lhecker commented on GitHub (Apr 19, 2024):

OH.

@lhecker commented on GitHub (Apr 19, 2024): OH.
Author
Owner

@tusharsnx commented on GitHub (Apr 19, 2024):

Also, we don't really need to clear the highlights (and we should absolutely not because that's going to be announced as results being cleared 🤔). All we need is when there's a pending call to refresh the highlights, we should mark current results within Search to be not fresh. So, when the renderer tries to read in between the pending call, it should get an empty list for the duration. Later, the throttled call would refresh the results and mark them as fresh again.

@tusharsnx commented on GitHub (Apr 19, 2024): Also, we don't really need to _clear_ the highlights (and we should absolutely not because that's going to be announced as results being cleared 🤔). All we need is when there's a pending call to refresh the highlights, we should mark current results within `Search` to be _not_ fresh. So, when the renderer tries to read in between the pending call, it should get an empty list for the duration. Later, the throttled call would refresh the results and mark them as fresh again.
Author
Owner

@lhecker commented on GitHub (Apr 19, 2024):

[...] and we should absolutely not because that's going to be announced as results being cleared

BTW I've removed the event and replaced it with

  • An "output is idle" event, which gets thrown whenever there wasn't any output for 100ms
  • ControlCore::Search() returns a SearchResults struct

TermControl owns ControlCore and because of that IMHO the former should be in charge of deciding when to call into the latter. Whenever ControlCore raises this generic "output is idle" event, TermControl calls _core.Search() and handles updating the UI synchronously. That way no search update event is needed.

So, when the renderer tries to read in between the pending call, it should get an empty list for the duration. Later, the throttled call would refresh the results and mark them as fresh again.

I may be misunderstanding you again, but you're suggesting to clear the search results after the reflow and then trigger a search update asynchronously, right? That's the same thing I had in mind. 🙂

@lhecker commented on GitHub (Apr 19, 2024): > [...] and we should absolutely not because that's going to be announced as results being cleared BTW I've removed the event and replaced it with * An "output is idle" event, which gets thrown whenever there wasn't any output for 100ms * `ControlCore::Search()` returns a `SearchResults` struct `TermControl` owns `ControlCore` and because of that IMHO the former should be in charge of deciding when to call into the latter. Whenever `ControlCore` raises this generic "output is idle" event, `TermControl` calls `_core.Search()` and handles updating the UI synchronously. That way no search update event is needed. > So, when the renderer tries to read in between the pending call, it should get an empty list for the duration. Later, the throttled call would refresh the results and mark them as fresh again. I may be misunderstanding you again, but you're suggesting to clear the search results after the reflow and then trigger a search update asynchronously, right? That's the same thing I had in mind. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21535