diff --git a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs index 2567932ce5..ce19b70089 100644 --- a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs +++ b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs @@ -45,12 +45,13 @@ impl ProcThreadAttributeList { pub fn set_pseudoconsole(&mut self, hpc: isize) -> io::Result<()> { let list = self.as_mut_ptr(); + let mut hpc_value = hpc; let ok = unsafe { UpdateProcThreadAttribute( list, 0, PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, - hpc as *mut _, + (&mut hpc_value as *mut isize).cast(), std::mem::size_of::(), std::ptr::null_mut(), std::ptr::null_mut(), diff --git a/codex-rs/windows-sandbox-rs/src/unified_exec/session.rs b/codex-rs/windows-sandbox-rs/src/unified_exec/session.rs index 5279d78596..cfae037adc 100644 --- a/codex-rs/windows-sandbox-rs/src/unified_exec/session.rs +++ b/codex-rs/windows-sandbox-rs/src/unified_exec/session.rs @@ -355,9 +355,10 @@ fn start_runner_stdin_writer( stdin_open: bool, ) -> tokio::task::JoinHandle<()> { tokio::task::spawn_blocking(move || { + let mut previous_was_cr = false; while let Some(bytes) = writer_rx.blocking_recv() { let bytes = if normalize_newlines { - normalize_windows_tty_input(&bytes) + normalize_windows_tty_input(&bytes, &mut previous_was_cr) } else { bytes };