MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / window_change_request

Method window_change_request

crates/openshell-supervisor-process/src/ssh.rs:390–415  ·  view source on GitHub ↗
(
        &mut self,
        channel: ChannelId,
        col_width: u32,
        row_height: u32,
        pixel_width: u32,
        pixel_height: u32,
        _session: &mut Session,
    )

Source from the content-addressed store, hash-verified

388 }
389
390 async fn window_change_request(
391 &mut self,
392 channel: ChannelId,
393 col_width: u32,
394 row_height: u32,
395 pixel_width: u32,
396 pixel_height: u32,
397 _session: &mut Session,
398 ) -> Result<(), Self::Error> {
399 let Some(state) = self.channels.get(&channel) else {
400 warn!("window_change_request on unknown channel {channel:?}");
401 return Ok(());
402 };
403 if let Some(master) = state.pty_master.as_ref() {
404 let winsize = Winsize {
405 ws_row: to_u16(row_height.max(1)),
406 ws_col: to_u16(col_width.max(1)),
407 ws_xpixel: to_u16(pixel_width),
408 ws_ypixel: to_u16(pixel_height),
409 };
410 if let Err(e) = unsafe_pty::set_winsize(master.as_raw_fd(), winsize) {
411 warn!("failed to resize PTY for channel {channel:?}: {e}");
412 }
413 }
414 Ok(())
415 }
416
417 async fn shell_request(
418 &mut self,

Callers

nothing calls this directly

Calls 3

to_u16Function · 0.85
set_winsizeFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected