Cancel and remove a monitoring task (internal use only).
(cls, bash_id: str)
| 180 | |
| 181 | @classmethod |
| 182 | def _cancel_monitor(cls, bash_id: str) -> None: |
| 183 | """Cancel and remove a monitoring task (internal use only).""" |
| 184 | if bash_id in cls._monitor_tasks: |
| 185 | task = cls._monitor_tasks[bash_id] |
| 186 | if not task.done(): |
| 187 | task.cancel() |
| 188 | del cls._monitor_tasks[bash_id] |
| 189 | |
| 190 | @classmethod |
| 191 | async def terminate(cls, bash_id: str) -> BackgroundShell: |