Execute a command in a session and wait for completion This function sends a command to the terminal, waits for it to complete using shell integration, and returns the output and exit code.
(
&self,
request: ExecuteCommandRequest,
)
| 417 | /// This function sends a command to the terminal, waits for it to complete |
| 418 | /// using shell integration, and returns the output and exit code. |
| 419 | pub async fn execute_command( |
| 420 | &self, |
| 421 | request: ExecuteCommandRequest, |
| 422 | ) -> TerminalResult<ExecuteCommandResponse> { |
| 423 | let options = ExecuteOptions { |
| 424 | timeout: request.timeout_ms.map(Duration::from_millis), |
| 425 | prevent_history: request.prevent_history.unwrap_or(true), |
| 426 | }; |
| 427 | |
| 428 | let result = self |
| 429 | .session_manager |
| 430 | .execute_command_with_options(&request.session_id, &request.command, options) |
| 431 | .await?; |
| 432 | |
| 433 | Ok(ExecuteCommandResponse::from(result)) |
| 434 | } |
| 435 | |
| 436 | /// Check if a session has shell integration enabled |
| 437 | pub async fn has_shell_integration(&self, session_id: &str) -> bool { |
no test coverage detected