Log a nicer error message when failing to read cwd of a process
This commit is contained in:
parent
ee166c5555
commit
70d5a5134f
@ -12,9 +12,9 @@ from typing import (
|
|||||||
|
|
||||||
import kitty.fast_data_types as fast_data_types
|
import kitty.fast_data_types as fast_data_types
|
||||||
|
|
||||||
from .utils import which
|
|
||||||
from .constants import is_macos, kitty_base_dir, shell_path, terminfo_dir
|
from .constants import is_macos, kitty_base_dir, shell_path, terminfo_dir
|
||||||
from .types import run_once
|
from .types import run_once
|
||||||
|
from .utils import log_error, which
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from typing import TypedDict
|
from typing import TypedDict
|
||||||
@ -200,9 +200,8 @@ class Child:
|
|||||||
if cwd_from is not None:
|
if cwd_from is not None:
|
||||||
try:
|
try:
|
||||||
cwd = cwd_of_process(cwd_from)
|
cwd = cwd_of_process(cwd_from)
|
||||||
except Exception:
|
except Exception as err:
|
||||||
import traceback
|
log_error(f'Failed to read cwd of {cwd_from} with error: {err}')
|
||||||
traceback.print_exc()
|
|
||||||
else:
|
else:
|
||||||
cwd = os.path.expandvars(os.path.expanduser(cwd or os.getcwd()))
|
cwd = os.path.expandvars(os.path.expanduser(cwd or os.getcwd()))
|
||||||
self.cwd = os.path.abspath(cwd)
|
self.cwd = os.path.abspath(cwd)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user