MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / resize_session

Method resize_session

crates/opencode-server/src/pty.rs:225–244  ·  view source on GitHub ↗
(&self, id: &str, cols: u16, rows: u16)

Source from the content-addressed store, hash-verified

223 }
224
225 pub async fn resize_session(&self, id: &str, cols: u16, rows: u16) -> Result<(), PtyError> {
226 let sessions = self.sessions.read().await;
227 let (_, inner) = sessions
228 .get(id)
229 .ok_or_else(|| PtyError::SessionNotFound(id.to_string()))?;
230
231 inner
232 .master
233 .lock()
234 .unwrap()
235 .resize(PtySize {
236 rows,
237 cols,
238 pixel_width: 0,
239 pixel_height: 0,
240 })
241 .map_err(|e| PtyError::IoError(e.to_string()))?;
242
243 Ok(())
244 }
245
246 pub async fn write_to_session(&self, id: &str, data: &[u8]) -> Result<(), PtyError> {
247 let data = data.to_vec();

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected