mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Indicate in kitty_run_data we are prewarmed
This commit is contained in:
@@ -292,7 +292,8 @@ def debug(*a: Any) -> None:
|
|||||||
print(*a, file=f)
|
print(*a, file=f)
|
||||||
|
|
||||||
|
|
||||||
def child_main(cmd: Dict[str, Any], ready_fd: int = -1) -> NoReturn:
|
def child_main(cmd: Dict[str, Any], ready_fd: int = -1, prewarm_type: str = 'direct') -> NoReturn:
|
||||||
|
getattr(sys, 'kitty_run_data')['prewarmed'] = prewarm_type
|
||||||
cwd = cmd.get('cwd')
|
cwd = cmd.get('cwd')
|
||||||
if cwd:
|
if cwd:
|
||||||
with suppress(OSError):
|
with suppress(OSError):
|
||||||
@@ -435,7 +436,7 @@ def fork_socket_child(child_data: SocketChildData, tty_fd: int, stdio_fds: Dict[
|
|||||||
fd = stdio_fds[which] if stdio_fds[which] > -1 else tty_fd
|
fd = stdio_fds[which] if stdio_fds[which] > -1 else tty_fd
|
||||||
safe_dup2(fd, getattr(sys, which).fileno())
|
safe_dup2(fd, getattr(sys, which).fileno())
|
||||||
free_non_child_resources()
|
free_non_child_resources()
|
||||||
child_main({'cwd': child_data.cwd, 'env': child_data.env, 'argv': child_data.argv})
|
child_main({'cwd': child_data.cwd, 'env': child_data.env, 'argv': child_data.argv}, prewarm_type='socket')
|
||||||
|
|
||||||
|
|
||||||
def fork_socket_child_supervisor(conn: socket.socket, free_non_child_resources: Callable[[], None]) -> None:
|
def fork_socket_child_supervisor(conn: socket.socket, free_non_child_resources: Callable[[], None]) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user