//! Tauri commands for local PTY session management. use tauri::{AppHandle, State}; use crate::pty::ShellInfo; use crate::AppState; #[tauri::command] pub fn list_available_shells(state: State<'_, AppState>) -> Vec { state.pty.list_shells() } #[tauri::command] pub fn spawn_local_shell( shell_path: String, cols: u32, rows: u32, app_handle: AppHandle, state: State<'_, AppState>, ) -> Result { state.pty.spawn(&shell_path, cols as u16, rows as u16, app_handle, &state.scrollback) } #[tauri::command] pub fn pty_write( session_id: String, data: String, state: State<'_, AppState>, ) -> Result<(), String> { state.pty.write(&session_id, data.as_bytes()) } #[tauri::command] pub fn pty_resize( session_id: String, cols: u32, rows: u32, state: State<'_, AppState>, ) -> Result<(), String> { state.pty.resize(&session_id, cols as u16, rows as u16) } #[tauri::command] pub fn disconnect_pty( session_id: String, state: State<'_, AppState>, ) -> Result<(), String> { state.pty.disconnect(&session_id) }