Fix cocoa being loaded before the fork on macOS
This commit is contained in:
parent
b5467b8e26
commit
57dfc379ae
@ -357,11 +357,6 @@ def set_locale() -> None:
|
|||||||
def _main() -> None:
|
def _main() -> None:
|
||||||
running_in_kitty(True)
|
running_in_kitty(True)
|
||||||
|
|
||||||
try:
|
|
||||||
set_locale()
|
|
||||||
except Exception:
|
|
||||||
log_error('Failed to set locale, ignoring')
|
|
||||||
|
|
||||||
args = sys.argv[1:]
|
args = sys.argv[1:]
|
||||||
if is_macos and os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES', None) == '1':
|
if is_macos and os.environ.pop('KITTY_LAUNCHED_BY_LAUNCH_SERVICES', None) == '1':
|
||||||
os.chdir(os.path.expanduser('~'))
|
os.chdir(os.path.expanduser('~'))
|
||||||
@ -407,6 +402,13 @@ def _main() -> None:
|
|||||||
prewarm = fork_prewarm_process(opts)
|
prewarm = fork_prewarm_process(opts)
|
||||||
if prewarm is None:
|
if prewarm is None:
|
||||||
raise SystemExit(1)
|
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
|
with suppress(AttributeError): # python compiled without threading
|
||||||
sys.setswitchinterval(1000.0) # we have only a single python thread
|
sys.setswitchinterval(1000.0) # we have only a single python thread
|
||||||
init_glfw(opts, cli_opts.debug_keyboard, cli_opts.debug_rendering)
|
init_glfw(opts, cli_opts.debug_keyboard, cli_opts.debug_rendering)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user