diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index fcaf4d2290..54b6c32270 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -648,7 +648,9 @@ impl App { use tokio_stream::StreamExt; let (app_event_tx, mut app_event_rx) = unbounded_channel(); let app_event_tx = AppEventSender::new(app_event_tx); + tui::log_windows_vt_output_mode("before_emit_project_config_warnings"); emit_project_config_warnings(&app_event_tx, &config); + tui::log_windows_vt_output_mode("after_emit_project_config_warnings"); emit_system_bwrap_warning(&app_event_tx, &config); tui.set_notification_settings( config.tui_notifications.method, diff --git a/codex-rs/tui/src/app/startup_prompts.rs b/codex-rs/tui/src/app/startup_prompts.rs index 802cda3f80..7749bf624f 100644 --- a/codex-rs/tui/src/app/startup_prompts.rs +++ b/codex-rs/tui/src/app/startup_prompts.rs @@ -60,6 +60,7 @@ pub(super) fn emit_project_config_warnings(app_event_tx: &AppEventSender, config message.push_str(&format!(" {reason}\n")); } + crate::tui::log_windows_vt_output_mode("before_project_config_warning_history"); app_event_tx.send(AppEvent::InsertHistoryCell(Box::new( history_cell::new_warning_event(message), ))); diff --git a/codex-rs/tui/src/branch_summary.rs b/codex-rs/tui/src/branch_summary.rs index 4698dc96e5..9ec68114cd 100644 --- a/codex-rs/tui/src/branch_summary.rs +++ b/codex-rs/tui/src/branch_summary.rs @@ -101,6 +101,7 @@ pub(crate) async fn current_branch_name( runner: &dyn WorkspaceCommandExecutor, cwd: &Path, ) -> Option { + crate::tui::log_windows_vt_output_mode("before_status_line_branch_lookup"); let output = run_git_command(runner, cwd, &["branch", "--show-current"]) .await .ok()?; diff --git a/codex-rs/tui/src/chatwidget/status_surfaces.rs b/codex-rs/tui/src/chatwidget/status_surfaces.rs index e34fe4688a..9372b31a68 100644 --- a/codex-rs/tui/src/chatwidget/status_surfaces.rs +++ b/codex-rs/tui/src/chatwidget/status_surfaces.rs @@ -426,6 +426,7 @@ impl ChatWidget { /// stable project label. fn status_line_project_root_for_cwd(&self, cwd: &Path) -> Option { if let Some(repo_root) = get_git_repo_root(cwd) { + crate::tui::log_windows_vt_output_mode("project_root_from_git"); return Some(repo_root); } diff --git a/codex-rs/tui/src/tui.rs b/codex-rs/tui/src/tui.rs index 9760b598d8..4203d4935c 100644 --- a/codex-rs/tui/src/tui.rs +++ b/codex-rs/tui/src/tui.rs @@ -282,6 +282,26 @@ fn apply_windows_vt_output_debug_override() { #[cfg(not(windows))] fn apply_windows_vt_output_debug_override() {} +#[cfg(windows)] +fn log_windows_pending_history_lines(pending_history_lines: &[PendingHistoryLines]) { + if debug_windows_vt_output_mode().is_none() { + return; + } + + let line_count: usize = pending_history_lines + .iter() + .map(|batch| batch.lines.len()) + .sum(); + tracing::info!( + batch_count = pending_history_lines.len(), + line_count, + "Windows pending history debug state" + ); +} + +#[cfg(not(windows))] +fn log_windows_pending_history_lines(_pending_history_lines: &[PendingHistoryLines]) {} + #[cfg(windows)] pub(crate) fn log_windows_vt_output_mode(phase: &'static str) { use windows_sys::Win32::System::Console::ENABLE_VIRTUAL_TERMINAL_PROCESSING; @@ -868,6 +888,7 @@ impl Tui { return Ok(()); } + log_windows_pending_history_lines(pending_history_lines); log_windows_vt_output_mode("before_insert_history"); for batch in pending_history_lines.iter() {