Starts a shell command and streams output through session notifications.\n\nArgs:\n params: Shell command to run, with optional working directory and timeout in milliseconds.\n\nReturns:\n Identifier of the spawned process, used to correlate streamed output and exit notifications.
(self, params: ShellExecRequest, *, timeout: float | None = None)
| 26567 | self._session_id = session_id |
| 26568 | |
| 26569 | async def exec(self, params: ShellExecRequest, *, timeout: float | None = None) -> ShellExecResult: |
| 26570 | "Starts a shell command and streams output through session notifications.\n\nArgs:\n params: Shell command to run, with optional working directory and timeout in milliseconds.\n\nReturns:\n Identifier of the spawned process, used to correlate streamed output and exit notifications." |
| 26571 | params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None} |
| 26572 | params_dict["sessionId"] = self._session_id |
| 26573 | return ShellExecResult.from_dict(await self._client.request("session.shell.exec", params_dict, **_timeout_kwargs(timeout))) |
| 26574 | |
| 26575 | async def kill(self, params: ShellKillRequest, *, timeout: float | None = None) -> ShellKillResult: |
| 26576 | "Sends a signal to a shell process previously started via \"shell.exec\".\n\nArgs:\n params: Identifier of a process previously returned by \"shell.exec\" and the signal to send.\n\nReturns:\n Indicates whether the signal was delivered; false if the process was unknown or already exited." |