mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
Fix Windows sandbox session formatting and syntax
This commit is contained in:
@@ -668,14 +668,23 @@ async fn driver_backed_process_can_resize_via_resizer_hook() -> anyhow::Result<(
|
||||
})),
|
||||
});
|
||||
|
||||
spawned.session.resize(TerminalSize { rows: 40, cols: 120 })?;
|
||||
spawned.session.resize(TerminalSize {
|
||||
rows: 40,
|
||||
cols: 120,
|
||||
})?;
|
||||
exit_tx.send(0).expect("send exit code");
|
||||
|
||||
let resized = tokio::time::timeout(tokio::time::Duration::from_secs(2), size_rx)
|
||||
.await
|
||||
.map_err(|_| anyhow::anyhow!("timed out waiting for resize"))?
|
||||
.expect("receive resized terminal size");
|
||||
assert_eq!(resized, TerminalSize { rows: 40, cols: 120 });
|
||||
assert_eq!(
|
||||
resized,
|
||||
TerminalSize {
|
||||
rows: 40,
|
||||
cols: 120
|
||||
}
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -536,7 +536,9 @@ fn resize_conpty_handle(
|
||||
if result == 0 {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(anyhow::anyhow!("failed to resize console: HRESULT {result}"))
|
||||
Err(anyhow::anyhow!(
|
||||
"failed to resize console: HRESULT {result}"
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -662,12 +664,13 @@ pub async fn spawn_windows_sandbox_session_legacy(
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(hpc) = hpc_for_wait
|
||||
&& let Ok(mut guard) = hpc.lock()
|
||||
&& let Some(hpc) = guard.take()
|
||||
{
|
||||
unsafe {
|
||||
ClosePseudoConsole(hpc);
|
||||
if let Some(hpc) = hpc_for_wait {
|
||||
if let Ok(mut guard) = hpc.lock() {
|
||||
if let Some(hpc) = guard.take() {
|
||||
unsafe {
|
||||
ClosePseudoConsole(hpc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unsafe {
|
||||
|
||||
@@ -305,7 +305,11 @@ fn runner_resizer_sends_resize_frame() {
|
||||
let pipe_write = std::sync::Arc::new(std::sync::Mutex::new(file));
|
||||
let mut resizer = super::make_runner_resizer(pipe_write);
|
||||
|
||||
resizer(codex_utils_pty::TerminalSize { rows: 45, cols: 132 }).expect("send resize frame");
|
||||
resizer(codex_utils_pty::TerminalSize {
|
||||
rows: 45,
|
||||
cols: 132,
|
||||
})
|
||||
.expect("send resize frame");
|
||||
|
||||
let mut reader = OpenOptions::new()
|
||||
.read(true)
|
||||
|
||||
Reference in New Issue
Block a user