(&self, id: &str)
| 210 | } |
| 211 | |
| 212 | pub async fn delete_session(&self, id: &str) -> bool { |
| 213 | let mut sessions = self.sessions.write().await; |
| 214 | if let Some((_, inner)) = sessions.remove(id) { |
| 215 | // Abort the background reader task |
| 216 | inner.reader_handle.abort(); |
| 217 | // Kill the child process |
| 218 | let _ = inner.child.lock().unwrap().kill(); |
| 219 | true |
| 220 | } else { |
| 221 | false |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | pub async fn resize_session(&self, id: &str, cols: u16, rows: u16) -> Result<(), PtyError> { |
| 226 | let sessions = self.sessions.read().await; |
no test coverage detected