Merge branch 'fix/fix_shell_detection' into 'master'

fix(activate): use exe instead of comm for parent shell detection

Closes IDF-11080

See merge request espressif/esp-idf!33378
This commit is contained in:
Roland Dobai 2024-09-09 23:03:22 +08:00
commit d5341bd455

View File

@ -107,7 +107,7 @@ def detect_shell(args: Any) -> str:
detected_shell_name = ''
while True:
parent_pid = psutil.Process(current_pid).ppid()
parent_name = psutil.Process(parent_pid).name()
parent_name = os.path.basename(psutil.Process(parent_pid).exe())
if not parent_name.lower().startswith('python'):
detected_shell_name = parent_name
conf.DETECTED_SHELL_PATH = psutil.Process(parent_pid).exe()