mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-03 21:00:27 +00:00
Fixes #10077 Clipboard read confirmations would immediately show a sheet which grabbed focus. This could be used for a bunch of dumb reasons, including DoS attacks. But, it also caused focus/sheet loops for programs that did OSC52 on focus changes (which was seen via some Neovim configs!). Now, if a surface is unfocused, we bell the surface and show the confirmation request on next focus. If the surface is not focused or another request comes in, we cancel the prior one. This also fixes some memory management issues around clipboard requests that were likely small leaks (didn't verify the old bug, but verified the new code, and eyeballed the old). To implement this, I decided to reorient the whole clipboard confirmation thing around state on SurfaceView (which simplifies memory management) and using Combine on BaseTerminalController to get notified.