From b9d7a661cec7ed453aef5c8516f5677f8948b23e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Mar 2026 09:46:22 +0530 Subject: [PATCH] Dont import ctypes unless type checking ctypes in Python 3.14 is broken on Intel macs. It uses libffi which is broken on Intel macs without extra security entitlements. At least com.apple.security.cs.allow-unsigned-executable-memory and possibly com.apple.security.cs.disable-executable-page-protection Rather than add these entitlements, we simply do not import ctypes as it is not actually used on macs anyway. Fixes #9643 --- docs/changelog.rst | 2 ++ kitty/fonts/render.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d4d804d5a..4e5a84f2b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -174,6 +174,8 @@ Detailed list of changes - Fix a regression that broke accept anyway shortcut in the paste confirmation dialog (:pull:`9640`) +- Fix kitty hanging on startup on Intel macs (:iss:`9643`) + 0.46.0 [2026-03-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/fonts/render.py b/kitty/fonts/render.py index 49220d94f..5aa88bd99 100644 --- a/kitty/fonts/render.py +++ b/kitty/fonts/render.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # License: GPL v3 Copyright: 2016, Kovid Goyal -import ctypes import os import sys from collections.abc import Callable, Generator @@ -218,6 +217,7 @@ def set_font_family(opts: Options | None = None, override_font_size: float | Non if TYPE_CHECKING: + import ctypes CBufType = ctypes.Array[ctypes.c_ubyte] else: CBufType = None