Fix excessive screen updates in progress indicators (#14206)

* Initial plan * Fix excessive screen updates during wsl --export Only update progress display when file size actually changes, preventing unnecessary screen redraws and reducing CPU/GPU overhead. Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Address code review: initialize previousSize to 0 instead of -1 Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Complete fix for excessive screen updates during wsl --export Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Clean up: remove codeql symlink and add to gitignore Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Revert .gitignore to original state Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Compare MB values instead of raw bytes to prevent unnecessary redraws When file size grows in sub-MB increments, comparing raw bytes causes redraws even though the displayed MB value hasn't changed. Now we calculate and compare the MB value directly, ensuring the progress indicator only updates when the displayed value actually changes. Also initialize previousSizeMB to -1 to ensure initial progress is always shown (even when starting at 0 MB). Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> * Cache string in UpdateProgress instead of caching values in caller Move the duplicate string check into ConsoleProgressIndicator::UpdateProgress() itself. This provides a more general solution that prevents printing the same string twice for any caller, not just the file size case. The comparison now happens at the string level, which handles all formatting variations and makes the fix more maintainable. Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

Copilot committed Feb 12, 2026 at 16:34 UTC 107fe524137dae94e8e2c3cb6fce37c6afcf7b0e
1 file changed +6
src/windows/common/ConsoleProgressIndicator.cpp
+6
@@ -49,6 +49,12 @@ void wsl::windows::common::ConsoleProgressIndicator::UpdateProgress(std::wstring
49 return;
50 }
51
52 + // Only update if the new progress message differs from the previous one
53 + if (Progress == m_progressMessage)
54 + {
55 + return;
56 + }
57 +
58 for (auto i = 0; i < m_progressMessage.size(); i++)
59 {
60 fwprintf(stderr, L"\b \b");