fix(tui): suppress verbose CLI logging on Windows alt-screen to prevent TUI leak#1910
fix(tui): suppress verbose CLI logging on Windows alt-screen to prevent TUI leak#1910aboimpinto wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces Windows-specific logic to suppress verbose logging when entering or resuming the TUI's alternate screen, aiming to prevent log output from corrupting the interface. Feedback indicates that this approach is currently permanent on Windows, unlike the scoped redirection used on Unix, and suggests restoring the verbosity state during cleanup. Additionally, the reviewer noted that this fix only addresses internal logging and recommended exploring WinAPI-based stderr redirection to handle third-party output and panics more effectively.
8404dbb to
3a7d69f
Compare
|
Addressed the code review feedback: |
d776f24 to
250f048
Compare
0762b7f to
14b5fea
Compare
3377e26 to
1d63574
Compare
|
Rebased onto current main (v0.8.44). Only 1 commit needed — the test commit was already upstream. |
|
Stewardship note: #1909 is now the canonical tracking issue for this Windows verbose-log leak, and the thinner duplicate #1904 was closed in favor of it. Keeping the issue open while this PR has a Windows failure; the next useful step is to inspect that failing check before deciding whether to merge, harvest, or revise. |
|
Fixed the composer_history flaky test (timeout 5s → 30s). The memory_guidance_matches_constitutional_tier_order failure is pre-existing on main (prompts.rs is unchanged by this PR). |
ce14c79 to
90eecae
Compare
|
Thanks @aboimpinto. I checked this while triaging v0.8.45 PRs. The current PR diff only contains Cargo.toml/Cargo.lock version/dependency churn and does not include the described alt-screen verbose logging change, so I’m not merging it as-is. I’m keeping #1909 open because the underlying Windows logging issue still needs an actual code fix or a restored patch. |
Summary
This is the missing second commit from PR #1776. The maintainer merged the first commit (stop
RUST_LOGfrom leaking tracing messages) but closed PR #1776 without merging this follow-up fix.Problem
On Windows,
stderrcannot be redirected to the log file (nodup2). When--verboseorDEEPSEEK_LOG_LEVEL=debugis set,eprintln!calls fromcrate::loggingstill leak into the TUI alt-screen buffer, corrupting the display � even after theRUST_LOGfix was merged.Fix
Call
crate::logging::set_verbose(false)at two points:run_tui()� right afterEnterAlternateScreen, so verbose logging is suppressed for the entire TUI session on Windows.resume_terminal()� right after re-entering alt-screen during terminal recovery, so the suppression holds across suspend/resume cycles.Changes
crates/tui/src/tui/ui.rs: +9 lines �set_verbose(false)calls inrun_tuiandresume_terminal, gated by#[cfg(windows)].Related
Urgent: this is a regression on Windows for users who run with verbose/debug logging.