Commit Graph

8048 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b8393fd4aa apprt/gtk: comments 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
e18a7d9501 apprt/gtk: drag 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
f7a6822e30 apprt/gtk: enter/shift+enter for traversing search results 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
72b3c14833 clean up some stuff 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
56a76cc174 apprt/gtk: fix selected search label off by one 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
eebce6a78c apprt/gtk: hook up close search button 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
76496d40fd apprt/gtk: hook up next/prev match 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
0ea85fc483 apprt/gtk: hook up search_total/search_selected apprt actions 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
fc9b578ef4 apprt/gtk: hook up search-changed to start a search 2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
0d32e7d814 apprt/gtk: escape to stop search and hide overlay 2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
778b49c9a1 apprt/gtk: hook up start_search/end_search to set active state 2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
027e5d631a config: default search keybindings for Linux 2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
548d1f0300 apprt/gtk: search overlay UI 2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
832883b600 apprt/gtk: move surface event controllers, block events from revealers 2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
4fef41bc83 terminal: renderstate needs to reset highlights on dirty (#9759)
This fixes memory corruption where future matches on a fully dirty row
would write highlights out of bounds. It was easy to reproduce in debug
by searching for `$` in `ghostty +boo`
2025-11-30 07:22:54 -08:00
Tim Culverhouse
a58e33c06b PageList: preserve size.cols in adjustCapacity after column shrink
When columns shrink during resize-without-reflow, page.size.cols is
updated but page.capacity.cols retains the old larger value. When
adjustCapacity later runs (e.g., to expand style/grapheme storage),
it was creating a new page using page.capacity which has the stale
column count, causing size.cols to revert to the old value.

This caused a crash in render.zig where an assertion checks that
page.size.cols matches PageList.cols.

Fix by explicitly copying page.size.cols to the new page after
creation, matching how size.rows is already handled.

Amp-Thread-ID: https://ampcode.com/threads/T-976bc49a-7bfd-40bd-bbbb-38f66fc925ff
Co-authored-by: Amp <amp@ampcode.com>
2025-11-30 07:20:54 -08:00
Mitchell Hashimoto
d7087627d7 terminal: renderstate needs to reset highlights on dirty
This fixes memory corruption where future matches on a fully dirty row
would write highlights out of bounds. It was easy to reproduce in debug
by searching for `$` in `ghostty +boo`
2025-11-30 07:18:42 -08:00
Mitchell Hashimoto
3754a94cb5 Allow list-theme action with --plain to sort with --color argument (#9748)
not an accepted issue
https://github.com/ghostty-org/ghostty/discussions/9745 but it seemed
simple enough to add, pretty much copies how the previewer sorts based
on color

This allows --color argument to work when using --plain to sort the list
returned
2025-11-29 14:02:57 -08:00
Mitchell Hashimoto
10f19ebdc3 search: handle soft-wrapped lines in sliding window properly
Fixes #9752
2025-11-29 07:32:06 -08:00
rhodes-b
351dd2ea51 allow list themes --plain to accept --color flag 2025-11-28 19:26:11 -06:00
Mitchell Hashimoto
dbfc3eb679 Remove unused imports 2025-11-27 13:37:53 -08:00
Mitchell Hashimoto
4ff0e0c9d2 input: remove the unused end search entry in the palette 2025-11-27 07:21:59 -08:00
Mitchell Hashimoto
842becbcaf terminal: PageList search should halt when pin becomes garbage
This means that the pin we're using to track our position in the
PageList was part of a node that got reused/recycled at some point. We
can't make any meaningful guarantees about the state of the PageList.

This only happens with scrollback pruning so we can treat it as a
complete search.
2025-11-26 16:36:44 -08:00
Mitchell Hashimoto
b96b55ebde terminal: RenderState must consider first row in dirty page dirty 2025-11-26 13:20:16 -08:00
Mitchell Hashimoto
9206b3dc9b renderer: manual selection should take priority over search matches
Previously it was impossible to select a search match. Well, it was
selecting but it wasn't showing that it was selected.
2025-11-26 10:28:28 -08:00
Mitchell Hashimoto
d85fc62774 search: reset selected match when the needle changes 2025-11-26 10:04:28 -08:00
Mitchell Hashimoto
5b4394d211 macos: end_search for ending search 2025-11-26 08:57:24 -08:00
Mitchell Hashimoto
c51170da9c add end_search binding 2025-11-26 08:50:06 -08:00
Mitchell Hashimoto
f91080a165 terminal: fix single-character search crashes 2025-11-26 08:50:06 -08:00
Mitchell Hashimoto
f252db1f1c terminal: handle pruning history for when active area removes it 2025-11-26 08:50:06 -08:00
Mitchell Hashimoto
330ce07d48 terminal: fix moving selection on history changing 2025-11-26 08:50:06 -08:00
Mitchell Hashimoto
ad755b0e3d core: always send start_search for refocus 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
48acc90983 terminal: search should reload active area if dirty 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
7320b234b4 core: surface sends search total/progress to apprt 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
2ee2d000f5 apprt actions for search progress 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
240d5e0fc5 config: default search keybindings for macos 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
5b2d66e261 apprt/gtk: disable search apprt actions 2025-11-26 08:50:04 -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
15f00a9cd1 renderer: setup proper dirty state on search selection changing 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
5ee000f58f macos: search input starts the search up 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
b7e70ce534 apprt: end_search 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
b084889782 config: cmd+f on macos start_search default 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
aeaa8d4ead add start_search binding and apprt action 2025-11-26 08:50:03 -08:00
Mitchell Hashimoto
20758fb80e Misc search fixes (#9711)
- ScreenSearch has to restart on resize. We don't have any good way to
handle reflow since our search results are unpinned. We can look into
this later but this fixes correctness.
- PageList now tracks serial number by node that monotonically increases
on any alloc or reuse. Our screen search uses this to prune invalid
history results.
2025-11-26 08:49:54 -08:00
Mitchell Hashimoto
9b7753a36f terminal: ScreenSearch prunes by min serial 2025-11-26 08:46:26 -08:00
Mitchell Hashimoto
30f189d774 terminal: PageList has page_serial_min 2025-11-26 08:41:26 -08:00
Mitchell Hashimoto
e549af76fe terminal: flattened highlights contain serial numbers for nodes 2025-11-26 08:36:29 -08:00
Mitchell Hashimoto
1786022ac3 terminal: ScreenSearch restarts on resize 2025-11-26 08:31:09 -08:00
Mitchell Hashimoto
8d11335ee4 terminal: PageList stores serial number for page nodes 2025-11-26 08:15:41 -08:00