mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 10:27:24 +00:00
Fix cocoa being loaded before the fork on macOS
This commit is contained in:
parent
b5467b8e26
commit
57dfc379ae
1 changed files with 7 additions and 5 deletions
|
|
@ -357,11 +357,6 @@ def set_locale() -> None:
|
|||
def _main() -> None:
|
||||
running_in_kitty(True)
|
||||
|
||||
try:
|
||||
set_locale()
|
||||
except Exception:
|
||||
log_error('Failed to set locale, ignoring')
|
||||
|
||||
args = sys.argv[1:]
|
||||
if is_macos and os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES', None) == '1':
|
||||
os.chdir(os.path.expanduser('~'))
|
||||
|
|
@ -407,6 +402,13 @@ def _main() -> None:
|
|||
prewarm = fork_prewarm_process(opts)
|
||||
if prewarm is None:
|
||||
raise SystemExit(1)
|
||||
|
||||
# set_locale on macOS uses cocoa APIs when LANG is not set, so we have to
|
||||
# call it after the fork
|
||||
try:
|
||||
set_locale()
|
||||
except Exception:
|
||||
log_error('Failed to set locale, ignoring')
|
||||
with suppress(AttributeError): # python compiled without threading
|
||||
sys.setswitchinterval(1000.0) # we have only a single python thread
|
||||
init_glfw(opts, cli_opts.debug_keyboard, cli_opts.debug_rendering)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue