Skip to content

fix(tui): calm legacy Windows console rendering#1655

Merged
Hmbown merged 1 commit into
mainfrom
work/v0.8.38-windows-conhost-flicker
May 15, 2026
Merged

fix(tui): calm legacy Windows console rendering#1655
Hmbown merged 1 commit into
mainfrom
work/v0.8.38-windows-conhost-flicker

Conversation

@Hmbown

@Hmbown Hmbown commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • detect unmarked legacy Windows console hosts separately from modern Windows terminals
  • auto-enable low-motion rendering, disable fancy animations, and resolve synchronized_output auto to off for that host class
  • make the startup viewport reset use the same terminal-quirk detection and surface the quirk in doctor
  • document the v0.8.38 fix and credit the safe slice harvested from [codex] fix Windows PowerShell flicker #1591

Fixes #1590.
Harvests the narrow Windows PowerShell/ConHost flicker fix from #1591.

Tests

  • ./scripts/release/check-versions.sh
  • cargo fmt --all -- --check
  • git diff --check
  • cargo test -p deepseek-tui --bin deepseek-tui legacy_windows_console --locked
  • cargo test -p deepseek-tui --bin deepseek-tui synchronized_output --locked
  • cargo test -p deepseek-tui --bin deepseek-tui low_motion --locked
  • cargo test -p deepseek-tui --bin deepseek-tui term_program --locked
  • cargo clippy -p deepseek-tui --bin deepseek-tui --tests --locked -- -D warnings

Copilot AI review requested due to automatic review settings May 14, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in Settings::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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +939 to +945
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))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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()))
}

@Hmbown Hmbown force-pushed the work/v0.8.38-windows-conhost-flicker branch from bc08613 to 06279eb Compare May 14, 2026 23:38
@Hmbown Hmbown merged commit b834548 into main May 15, 2026
12 checks passed
@Hmbown Hmbown deleted the work/v0.8.38-windows-conhost-flicker branch May 15, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Windows PowerShell text overlaps and flickers

2 participants