fix(tui): calm legacy Windows console rendering#1655
Conversation
There was a problem hiding this comment.
Pull request overview
Adds detection for legacy Windows ConHost (plain PowerShell/cmd.exe) and applies calmer rendering defaults (low_motion, no fancy_animations, sync output off) to fix flickering/overlapping text described in #1590.
Changes:
- New
detected_legacy_windows_console_host()helper plus env-override behavior inSettings::apply_env_overrides. - Doctor output and startup viewport reset both consult the new quirk detection.
- Changelog entries credit the harvested fix from #1591.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/tui/src/settings.rs | Adds legacy Windows console detection + env-override branch and tests. |
| crates/tui/src/tui/ui.rs | Disables initial sync-output viewport reset on legacy Windows console hosts. |
| crates/tui/src/main.rs | Reports the legacy Windows console quirk in deepseek doctor. |
| crates/tui/CHANGELOG.md | Documents the v0.8.38 fix and credits #1591 author. |
| CHANGELOG.md | Mirrors the TUI changelog entry at the workspace root. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces detection for legacy Windows console hosts to mitigate flickering by automatically enabling low-motion mode and disabling fancy animations and synchronized output. These adjustments are applied across the settings, diagnostic tools, and TUI startup. A review comment suggests refactoring the environment variable detection helper to use a generic constant for its array size, which would improve maintainability and flexibility for future updates.
| fn legacy_windows_console_host_env(markers: [Option<&std::ffi::OsStr>; 8]) -> bool { | ||
| fn has_value(value: Option<&std::ffi::OsStr>) -> bool { | ||
| value.is_some_and(|v| !v.is_empty()) | ||
| } | ||
|
|
||
| markers.into_iter().all(|value| !has_value(value)) | ||
| } |
There was a problem hiding this comment.
The helper function legacy_windows_console_host_env uses a hardcoded array size of 8. Using a generic constant N for the array size makes the function more flexible and avoids the need to update the signature if more terminal markers are added to the detection logic in the future. This also simplifies the implementation by removing the nested helper function.
fn legacy_windows_console_host_env<const N: usize>(markers: [Option<&std::ffi::OsStr>; N]) -> bool {
markers.into_iter().all(|v| !v.is_some_and(|s| !s.is_empty()))
}bc08613 to
06279eb
Compare
Summary
Fixes #1590.
Harvests the narrow Windows PowerShell/ConHost flicker fix from #1591.
Tests