mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-09-03 21:00:27 +00:00
OSC8 hyperlinks previously executed directly via the NSWorkspace opener so a malicious application can just do whatever it wanted and trick the user into opening something through Launch Services. This PR notifies apprt of OSC8 hyperlinks so they can be handled specially. In this PR, I added macOS-specific handling of OSC8 through a variety of improvements: - Preview text is sanitized, so invisible Unicode characters now show. - Questionable-looking URLs require confirmation to open, but a user can confirm to open. - Very questionable or definitely unsafe URLs are blocked with an alert that only allows the user to copy the link. The alert also notifies the user why. This PR also adds an explicit `link-osc8` config (default true) that users can use to disable osc8 completely. ## Demos ### Custom URL Schemes (Confirm) <img width="1432" height="1110" alt="CleanShot 2026-08-05 at 10 25 57@2x" src="https://github.com/user-attachments/assets/f7773ca2-3389-4749-a5c9-393ae097c044" /> ### Invisible Characters (Block) <img width="1432" height="1110" alt="CleanShot 2026-08-05 at 10 26 44@2x" src="https://github.com/user-attachments/assets/bd2d0f33-f128-46e8-9bdb-227afecbb942" /> ### Executable Target (Block) <img width="1432" height="1110" alt="CleanShot 2026-08-05 at 10 27 31@2x" src="https://github.com/user-attachments/assets/080c0524-2c8e-4931-892f-d2643a5d0d4e" />