mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Use absolute path when serializing foreground process
This commit is contained in:
@@ -20,6 +20,7 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
if is_macos:
|
||||
from kitty.fast_data_types import abspath_of_process as _abspath_of_process
|
||||
from kitty.fast_data_types import cmdline_of_process as cmdline_
|
||||
from kitty.fast_data_types import cwd_of_process as _cwd
|
||||
from kitty.fast_data_types import environ_of_process as _environ_of_process
|
||||
@@ -30,6 +31,9 @@ if is_macos:
|
||||
# anyway but we use realpath for extra safety.
|
||||
return os.path.realpath(_cwd(pid))
|
||||
|
||||
def abspath_of_exe(pid: int) -> str:
|
||||
return os.path.realpath(_abspath_of_process(pid))
|
||||
|
||||
def process_group_map() -> DefaultDict[int, list[int]]:
|
||||
ans: DefaultDict[int, list[int]] = defaultdict(list)
|
||||
for pid, pgid in _process_group_map():
|
||||
@@ -82,6 +86,9 @@ else:
|
||||
ans[q].append(pid)
|
||||
return ans
|
||||
|
||||
def abspath_of_exe(pid: int) -> str:
|
||||
return os.path.realpath(f'/proc/{pid}/exe')
|
||||
|
||||
|
||||
@run_once
|
||||
def checked_terminfo_dir() -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user