Skip to content

Conversation

@mitchellh
Copy link
Contributor

@mitchellh mitchellh commented Nov 26, 2025

#189 for macOS

This adds a search GUI for macOS, including macOS-standard menu bar items, and keybindings that match other native macOS applications such as Terminal app, Safari, and others. This introduces a new keybinding action start_search to start a blank search for GUIs.

This PR also resolves a number of minor issues found in the search subsystem and renderer related to search from prior PRs. This should result in overall improved search stability. Please note there are still known issues (bottom of this PR).

Warning

A note on stability: I know a lot of people are eager to have this feature, and I'm excited
for this feature to soon be available in tip releases. But note that new features like this are
always filled with performance issues, bugs, crashes, etc. That's the point of tip releases:
to find and address these before wider availability. We will do our best to respond rapidly to
major issues found in tip, but don't expect perfect functionality immediately!

Demo

CleanShot.2025-11-25.at.22.18.58.mp4

Note

You can drag the search window to any of the four corners if its getting in the way of reading the terminal.

Known Issues

TODO prior to this PR merging:

  • Single-byte search terms cause a crash since our sliding window can't handle it. This PR temporarily requires search terms with length 2+ before starting a search to avoid it. 😄
  • The way ScreenSearch prunes history is fundamental unsafe. With a rapidly growing screen that could reach history limits and an active search at the same time, Ghostty is almost guaranteed to crash currently. The workaround is to not search actively scrolling screens (new data) for now.

@mitchellh mitchellh mentioned this pull request Nov 26, 2025
8 tasks
@heri16

This comment was marked as spam.

@ftpd

This comment was marked as off-topic.

@mitchellh
Copy link
Contributor Author

@ftpd Sorry, this is not a place for discussion about future functionality.

@mitchellh mitchellh marked this pull request as ready for review November 26, 2025 16:51
@mitchellh mitchellh requested review from a team as code owners November 26, 2025 16:51
@mitchellh mitchellh added this to the 1.3.0 milestone Nov 26, 2025
@mitchellh mitchellh merged commit 71a2dad into main Nov 26, 2025
114 checks passed
@mitchellh mitchellh deleted the search-macos branch November 26, 2025 17:09
@mitchellh
Copy link
Contributor Author

Broke my own rules with this one, but for AI disclosure: Amp was used for the GUI (visuals, not logic). I reviewed it all. Everything else is organic.

@injust
Copy link
Contributor

injust commented Nov 27, 2025

A few things I noticed (LMK if you prefer me opening new/separate discussions):

"End Search" appears twice in the command palette (fixed in 4ff0e0c):

  • command-palette-entry = title:"End Search",... appears twice in the default config, but with different descriptions/actions

esc and cmd-shift-f are both bound to end_search, but neither immediately closes the search UI:

  • end_search's command palette description is "End the current search if any and hide any GUI elements", so it seems like it should close the search UI immediately
  • When the search field is focused, esc shifts the focus back to the shell without closing the search field, and it takes a 2nd esc to close the search UI
  • cmd-shift-f seems to do nothing when the search field is focused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants