diff --git a/kitty/fast_data_types.pyi b/kitty/fast_data_types.pyi index c6d55e41c..95feff2c9 100644 --- a/kitty/fast_data_types.pyi +++ b/kitty/fast_data_types.pyi @@ -1483,3 +1483,6 @@ class SingleKey: def __iter__(self) -> Iterator[int]: ... def _replace(self, mods: int = 0, is_native: object = False, key: int = -1) -> 'SingleKey': ... def resolve_kitty_mod(self, mod: int) -> 'SingleKey': ... + + +def set_use_os_log(yes: bool) -> None: ... diff --git a/kitty/logging.c b/kitty/logging.c index 3c6f73305..fd45eb0e3 100644 --- a/kitty/logging.c +++ b/kitty/logging.c @@ -59,8 +59,15 @@ log_error_string(PyObject *self UNUSED, PyObject *args) { Py_RETURN_NONE; } +static PyObject* +set_use_os_log(PyObject *self UNUSED, PyObject *args) { + use_os_log = PyObject_IsTrue(args) ? true : false; + Py_RETURN_NONE; +} + static PyMethodDef module_methods[] = { METHODB(log_error_string, METH_VARARGS), + METHODB(set_use_os_log, METH_O), {NULL, NULL, 0, NULL} /* Sentinel */ }; diff --git a/kitty/prewarm.py b/kitty/prewarm.py index 9c13f8c72..2ba954e9c 100644 --- a/kitty/prewarm.py +++ b/kitty/prewarm.py @@ -29,7 +29,7 @@ from kitty.entry_points import main as main_entry_point from kitty.fast_data_types import ( CLD_EXITED, CLD_KILLED, CLD_STOPPED, get_options, getpeereid, install_signal_handlers, read_signals, remove_signal_handlers, safe_pipe, - set_options + set_options, set_use_os_log ) from kitty.options.types import Options from kitty.shm import SharedMemory @@ -869,6 +869,7 @@ def fork_prewarm_process(opts: Options, use_exec: bool = False) -> Optional[Prew p.reload_kitty_config() return p # child + set_use_os_log(False) safe_close(stdin_write) safe_close(stdout_read) safe_close(death_notify_read)