diff --git a/markbase-core/src/ssh_server/channel.rs b/markbase-core/src/ssh_server/channel.rs index 8904b2e..65d59f4 100644 --- a/markbase-core/src/ssh_server/channel.rs +++ b/markbase-core/src/ssh_server/channel.rs @@ -1517,6 +1517,11 @@ direct_tcpip: None, let display = std::env::var("DISPLAY").unwrap_or_else(|_| ":0".to_string()); let x11_ctx = super::x11_forward::X11ForwardContext::new(&display)?; + // Phase 4: 保存 X11ForwardContext 到 Channel + if let Some(ch) = self.channels.get_mut(&channel) { + ch.x11_forward_context = Some(x11_ctx.clone()); + } + // 设置 DISPLAY 环境变量(client 会使用) // Server 需要在 exec/shell 环境中设置 DISPLAY // 这里只是记录,实际设置在 exec/shell handler 中