(
session_id: String,
state: State<'_, TerminalState>,
)
| 445 | |
| 446 | #[tauri::command] |
| 447 | pub async fn terminal_get( |
| 448 | session_id: String, |
| 449 | state: State<'_, TerminalState>, |
| 450 | ) -> Result<SessionResponse, String> { |
| 451 | // Try remote first (by session_id lookup, not global flag) |
| 452 | if let Some(remote_manager) = get_remote_workspace_manager() { |
| 453 | if let Some(terminal_manager) = remote_manager.get_terminal_manager().await { |
| 454 | if let Some(session) = terminal_manager.get_session(&session_id).await { |
| 455 | return Ok(SessionResponse { |
| 456 | id: session.id, |
| 457 | name: session.name, |
| 458 | shell_type: "Remote".to_string(), |
| 459 | cwd: session.cwd, |
| 460 | pid: session.pid, |
| 461 | status: format!("{:?}", session.status), |
| 462 | cols: session.cols, |
| 463 | rows: session.rows, |
| 464 | connection_id: Some(session.connection_id), |
| 465 | source: format_session_source(&session.source), |
| 466 | }); |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | let api = state.get_or_init_api().await?; |
| 472 | |
| 473 | let session = api |
| 474 | .get_session(&session_id) |
| 475 | .await |
| 476 | .map_err(|e| format!("Failed to get session: {}", e))?; |
| 477 | |
| 478 | Ok(SessionResponse::from(session)) |
| 479 | } |
| 480 | |
| 481 | #[tauri::command] |
| 482 | pub async fn terminal_list( |
nothing calls this directly
no test coverage detected