(
&self,
id: &str,
command: Option<&str>,
cwd: Option<&str>,
)
| 189 | } |
| 190 | |
| 191 | pub async fn update_session( |
| 192 | &self, |
| 193 | id: &str, |
| 194 | command: Option<&str>, |
| 195 | cwd: Option<&str>, |
| 196 | ) -> Result<PtySession, PtyError> { |
| 197 | let mut sessions = self.sessions.write().await; |
| 198 | |
| 199 | if let Some((session, _)) = sessions.get_mut(id) { |
| 200 | if let Some(cmd) = command { |
| 201 | session.command = cmd.to_string(); |
| 202 | } |
| 203 | if let Some(dir) = cwd { |
| 204 | session.cwd = dir.to_string(); |
| 205 | } |
| 206 | Ok(session.clone()) |
| 207 | } else { |
| 208 | Err(PtyError::SessionNotFound(id.to_string())) |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | pub async fn delete_session(&self, id: &str) -> bool { |
| 213 | let mut sessions = self.sessions.write().await; |
no test coverage detected