Implement SSH X11 forwarding Phase 4: Save X11ForwardContext
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

- Save X11ForwardContext to Channel.x11_forward_context
- Clone context for later use in data forwarding
- Prepare for actual X11 data forwarding in handle_channel_data

All 182 tests pass.
This commit is contained in:
Warren
2026-06-21 02:32:32 +08:00
parent df707bee7e
commit b24e4f727b

View File

@@ -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 中