Commit Graph

22 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2044e5030f terminal: make stream processing infallible
The terminal.Stream next/nextSlice functions can now no longer fail.
All prior failure modes were fully isolated in the handler `vt`
callbacks. As such, vt callbacks are now required to not return an error
and handle their own errors somehow.

Allowing streams to be fallible before was an incorrect design. It
caused problematic scenarios like in `nextSlice` early terminating
processing due to handler errors. This should not be possible.

There is no safe way to bubble up vt errors through the stream because
if nextSlice is called and multiple errors are returned, we can't
coalesce them. We could modify that to return a partial result but its
just more work for stream that is unnecessary. The handler can do all of
this.

This work was discovered due to cleanups to prepare for more C APIs.
Less errors make C APIs easier to implement! And, it helps clean up our
Zig, too.
2026-03-13 13:56:14 -07:00
Mitchell Hashimoto
f54ac11080 terminal: search will re-scroll to navigate to a single match
Fixes #9958
Replaces #9989

This changes the search navigation logic to always scroll if there is a
selected search result so long as the search result isn't already within
the viewport.
2025-12-25 13:50:02 -08:00
Mitchell Hashimoto
dbfc3eb679 Remove unused imports 2025-11-27 13:37:53 -08:00
Mitchell Hashimoto
d85fc62774 search: reset selected match when the needle changes 2025-11-26 10:04:28 -08:00
Mitchell Hashimoto
48acc90983 terminal: search should reload active area if dirty 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
72708b8253 search: do not restart search if needle doesn't change 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
ad8a6e0642 search thread needs to take an allocated needle 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
d0334b7ab6 search: scroll to selected search match 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
333dd08c97 search: thread dispatches selection notices, messages 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
d0e3a79a74 reset search on needle change or quit 2025-11-24 19:55:27 -08:00
Mitchell Hashimoto
061d157b50 terminal: search should use active area dirty tracking 2025-11-24 19:55:27 -08:00
Mitchell Hashimoto
e49f4a6dbc search binding action starts a search thread on surface 2025-11-24 19:55:27 -08:00
Mitchell Hashimoto
6623c20c2d terminal: switch search to use flattened highlights 2025-11-24 19:55:27 -08:00
Mitchell Hashimoto
79af2378d2 terminal: unify all notification sending into the notify command 2025-11-15 19:48:09 -08:00
Mitchell Hashimoto
90a6ea7aa5 terminal: note some search thread TODOs we can address later 2025-11-15 14:03:27 -08:00
Mitchell Hashimoto
f0af63db15 terminal: search thread refresh timer to reconcile state 2025-11-15 13:43:26 -08:00
Mitchell Hashimoto
acab8c90a2 terminal: search.Thread searches viewport and notifies viewport results 2025-11-15 13:30:32 -08:00
Mitchell Hashimoto
bfa397b196 terminal: search thread active screen reconciliation loop 2025-11-14 21:24:18 -08:00
Mitchell Hashimoto
1867928b84 terminal: search thread search ticking 2025-11-14 21:05:05 -08:00
Mitchell Hashimoto
d1ad32eadd terminal: search.Thread starting search loop 2025-11-14 17:04:34 -08:00
Mitchell Hashimoto
19dfc0aa98 terminal: search.Thread more boilerplate, test starting 2025-11-14 16:29:45 -08:00
Mitchell Hashimoto
8848e98271 terminal: search thread boilerplate (does nothing) 2025-11-12 10:07:21 -08:00