Commit Graph

13146 Commits

Author SHA1 Message Date
Mitchell Hashimoto
1bb2d4f1c2 macos: only end search if we previously had one 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
93656fca5a macos: show progerss correctly for search 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
0e974f85ed macos: fix iOS build 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
c20af77f98 macos: handle search progress/total apprt actions 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
d4a2f3db71 macos: search overlay shows search progress 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
7835ad0ea4 macos: more menu items 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
3f7cfca4b4 macos: add find menu item 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto
949a8ea53f macos: dummy search state for iOS 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
cfbc219f5c macos: enter and shift+enter move the results 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
efc05523e0 macos: enter goes to next result 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
3ce19a02ba macos: hook up the next/prev search buttons 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
081d73d850 macos: changes to SearchState trigger calls to internals 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
56d4a7f58e macos: start_search refocuses the search input 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto
c61d28a3a4 macos: esc returns focus back to surface 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
bc44b187d6 macos: hook up start_search apprt action to open search 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
b87d57f029 macos: search overlay 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
Mitchell Hashimoto
d9529947a4 apprt/gtk: (clipboard) fix GTK internal paste of UTF-8 content (#9710)
When pasting text in GTK, the current version properly prioritizes
text/plain;charset=utf-8 when the content is offered by another
application, but when pasting from ghostty to itself the mime type
selection algorithm prefers the offer order and matches `text/plain`,
which then converts non-ASCII UTF-8 into a bunch of escaped hex
characters (e.g. 日本語 becomes \E6\97\A5\E6\9C\AC\E8\AA\9E)

This is being discussed on the GTK side[1], but until everyone gets an
updated GTK it cannot hurt to offer the UTF-8 variant first (and one of
the GTK dev claims it actually is a bug not to do it, but the wayland
spec is not clear about it, so other clients could behave similarly)

Link: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9189 [1]
Fixes #9682
2025-11-26 06:19:18 -08:00
Dominique Martinet
53d0abf4dc apprt/gtk: (clipboard) fix GTK internal paste of UTF-8 content
When pasting text in GTK, the current version properly prioritizes
text/plain;charset=utf-8 when the content is offered by another
application, but when pasting from ghostty to itself the mime type
selection algorithm prefers the offer order and matches `text/plain`,
which then converts non-ASCII UTF-8 into a bunch of escaped hex
characters (e.g. 日本語 becomes \E6\97\A5\E6\9C\AC\E8\AA\9E)

This is being discussed on the GTK side[1], but until everyone gets an
updated GTK it cannot hurt to offer the UTF-8 variant first (and one of
the GTK dev claims it actually is a bug not to do it, but the wayland
spec is not clear about it, so other clients could behave similarly)

Link: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9189 [1]
Fixes #9682
2025-11-26 12:59:59 +00:00
Mitchell Hashimoto
14abc6a49d search: navigable search results (previous/next) (#9702)
Continuing #189

This adds the `navigate_search:previous` and `next` key bindings which
allow search matches to be navigated. The currently selected search
match is highlighted using a new `search-selected-foreground/background`
configuration with a reasonable default.

As search results are navigated, the viewport moves to keep them
visible.

## Demo



https://github.com/user-attachments/assets/facc9f3e-e327-4c65-b5f7-0279480ac357
2025-11-25 11:13:37 -08:00
Mitchell Hashimoto
7fba2da404 better default search match color 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
d0334b7ab6 search: scroll to selected search match 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
ba7b816af0 core: bindings for navigate_search 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
880db9fdd0 renderer: hook up search selection match highlighting 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
a2a771bb6f search: previous match 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
c38e098c4c search: fixup selected search when reloading active area 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
23479fe409 search: select next search match 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
08f57ab6d6 search: prune invalid history entries on feed 2025-11-25 11:05:38 -08:00
Mitchell Hashimoto
9511b237f3 macOS: fix the animation of showing&hiding command palette (#9698)
https://github.com/user-attachments/assets/0069d634-4156-486f-9b59-141fb4565a19

> [!NOTE]
> AI proofread my comments.
2025-11-25 09:47:12 -08:00
Mitchell Hashimoto
727430c110 benchmarks: align read_buf to cache line (#9700)
This aligns the `read_buf`s in `src/benchmark` to the cache line, so
that we don't leave that alignment up to chance in case it can very
slightly affect the benchmarks.

I ran the before and after on a few of the benchmarks and I don't think
it changes much (data is 200 MiB from `ghostty-gen`):

### codepoint-width

<img width="1738" height="470" alt="CleanShot 2025-11-25 at 09 10 14@2x"
src="https://github.com/user-attachments/assets/f4ea3014-db21-4a4a-8d67-49161829a4b4"
/>

### grapheme-break

<img width="1726" height="470" alt="CleanShot 2025-11-25 at 09 10 51@2x"
src="https://github.com/user-attachments/assets/d99d220b-3221-4adc-b7f5-58c7b86765bb"
/>

### is-symbol

<img width="1654" height="466" alt="CleanShot 2025-11-25 at 09 11 09@2x"
src="https://github.com/user-attachments/assets/d55e6c12-a650-49cc-aee9-b887eccd42dd"
/>

AI: no AI, just a simple replace.
2025-11-25 09:46:25 -08:00
Jacob Sandlund
807febcb5e benchmarks: align read_buf to cache line 2025-11-25 09:07:21 -05:00
Lukas
2a627a4665 macOS: fix the animation of showing&hiding command palette 2025-11-25 11:22:14 +01:00