mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 03:01:14 +03:00
Fix unhandled exceptions not being printed to stderr on macOS when run from launch services and using prewarming
This commit is contained in:
parent
48a9584688
commit
56f45e8b0f
@ -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: ...
|
||||
|
@ -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 */
|
||||
};
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user