Report the correct cmdline for prewarmed processes
This commit is contained in:
parent
0ed7b2f3c0
commit
6807f4d4ea
@ -339,7 +339,7 @@ class Child:
|
||||
ans = cmdline_of_pid(pid)
|
||||
except Exception:
|
||||
ans = []
|
||||
if not ans and pid == self.pid:
|
||||
if pid == self.pid and (not ans or (self.is_prewarmed and fast_data_types.get_boss().prewarm.is_prewarmed_argv(ans))):
|
||||
ans = list(self.argv)
|
||||
return ans
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ from contextlib import suppress
|
||||
from dataclasses import dataclass
|
||||
from importlib import import_module
|
||||
from typing import (
|
||||
IO, TYPE_CHECKING, Any, Dict, List, NoReturn, Optional, Union, cast
|
||||
IO, TYPE_CHECKING, Any, Dict, List, NoReturn, Optional, Sequence, Union,
|
||||
cast
|
||||
)
|
||||
|
||||
from kitty.constants import kitty_exe
|
||||
@ -79,6 +80,11 @@ class PrewarmProcess:
|
||||
opts = get_options()
|
||||
return json.dumps({'paths': opts.config_paths, 'overrides': opts.config_overrides})
|
||||
|
||||
def is_prewarmed_argv(self, argv: Sequence[str]) -> bool:
|
||||
if argv[:2] != [kitty_exe(), '+runpy']:
|
||||
return False
|
||||
return len(argv) > 2 and argv[2].startswith('from kitty.prewarm import main; main(')
|
||||
|
||||
def ensure_worker(self) -> None:
|
||||
if not self.worker_started:
|
||||
import subprocess
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user