Files
ghostty/macos/Sources/Features/Global Keybinds
Mitchell Hashimoto 2b6a1e41fc macos: avoid leaking ports while awaiting accessibility
#11799

Creating a CGEventTap without Accessibility permission leaks a Mach
port inside CoreGraphics on every failed attempt. The global keybind
listener retried this once per second while waiting for permission, so
Ghostty eventually exhausted the process port limit.

Request Accessibility access once, poll AXIsProcessTrusted while
access is denied, and create the event tap only after access is
granted. Stop polling before creation so an unrelated tap failure
cannot restart the leaking retry loop.
2026-08-03 20:41:39 -07:00
..