(pid: int)
| 353 | |
| 354 | |
| 355 | def _pid_exists(pid: int) -> bool: |
| 356 | try: |
| 357 | return any(subprocess.check_output(['ps', '--no-headers', '-o', 'pid', '-p', str(pid)]).strip()) |
| 358 | except subprocess.CalledProcessError: |
| 359 | return False |
| 360 | |
| 361 | |
| 362 | def _cmd_history(cmd: list[str]) -> None: |