chore(tui): log repo startup vt debug phases

This commit is contained in:
Felipe Coury
2026-05-20 14:12:29 -03:00
parent 9376d0b7ed
commit ed70bf0eda
5 changed files with 26 additions and 0 deletions

View File

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

View File

@@ -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),
)));

View File

@@ -101,6 +101,7 @@ pub(crate) async fn current_branch_name(
runner: &dyn WorkspaceCommandExecutor,
cwd: &Path,
) -> Option<String> {
crate::tui::log_windows_vt_output_mode("before_status_line_branch_lookup");
let output = run_git_command(runner, cwd, &["branch", "--show-current"])
.await
.ok()?;

View File

@@ -426,6 +426,7 @@ impl ChatWidget {
/// stable project label.
fn status_line_project_root_for_cwd(&self, cwd: &Path) -> Option<PathBuf> {
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);
}

View File

@@ -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() {