Mountain/RPC/CocoonService/Terminal/
ResizeTerminal.rs1#![allow(non_snake_case)]
2
3use serde_json::json;
9use tauri::Emitter;
10use tonic::{Response, Status};
11
12use crate::{
13 RPC::CocoonService::CocoonServiceImpl,
14 Vine::Generated::{Empty, ResizeTerminalRequest},
15 dev_log,
16};
17
18pub async fn Fn(Service:&CocoonServiceImpl, Request:ResizeTerminalRequest) -> Result<Response<Empty>, Status> {
19 dev_log!(
20 "cocoon",
21 "[CocoonService] resize_terminal: id={} cols={} rows={}",
22 Request.terminal_id,
23 Request.cols,
24 Request.rows
25 );
26
27 let _ = Service.environment.ApplicationHandle.emit(
28 "sky://terminal/resize",
29 json!({ "id": Request.terminal_id, "cols": Request.cols, "rows": Request.rows }),
30 );
31
32 Ok(Response::new(Empty {}))
33}