-
-
Notifications
You must be signed in to change notification settings - Fork 124
fix(windows): keep VT enabled during progress #1465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1465 +/- ##
=======================================
Coverage 91.35% 91.35%
=======================================
Files 87 87
Lines 18187 18189 +2
=======================================
+ Hits 16615 16617 +2
Misses 1572 1572 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (22.5 MiB → 22.5 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
f7e1e45 to
762d114
Compare
|
Keeping in draft until @chrisoro or someone with a Windows machine can confirm this actually fixes the issue lolol |
|
Any chance to build arm64 version of it? I won't have access to my amd64 win machine until end of next week. I do have windows on arm as a vm on my mac |
|
Just did a dummy change to @chrisoro The link for the ARM Windows standalone binary specifically is https://github.com/j178/prek/actions/runs/21322541711/artifacts/5245733919. Looks like it's a zip file in another zip file lol, but the inner zip has a Let me know how it goes! |
|
Tried the arm executable and it shows the same errors in both cmd and powershell. Maybe it is the region/language setting in Windows? Mine is set to Germany / German |
Some Windows hook installers (uv, pip, npm, cargo) disable ENABLE_VIRTUAL_TERMINAL_PROCESSING on exit, which causes indicatif's progress output to render as raw ANSI escape sequences. Re-enable VT mode after subprocess output() and status() calls to restore console state before prek resumes its own output.
Subprocesses like uv/pip/npm can disable ENABLE_VIRTUAL_TERMINAL_PROCESSING while indicatif's spinner is actively rendering, causing raw ANSI escape sequences to appear mid-install. Add a Windows-only background thread that re-enables VT mode every 200ms (matching the spinner tick rate) while progress bars are visible. The thread is scoped to ProgressReporter lifetime and only spawns when color is enabled.
bf6d4cc to
dd596f1
Compare
|
Sad, can you try the latest build? Tried some more changes. |
|
Nice, this seems to have done the trick. I can't overserve the broken output anymore. See: https://streamable.com/qaa5qs |
|
Awesome! Just to confirm, you were able to consistently reproduce in both cmd and powershell in prek 0.3.0, but the bug is consistently gone in both shells with the fix? |
Some Windows hook installers (uv, pip, npm, cargo) disable
ENABLE_VIRTUAL_TERMINAL_PROCESSINGon exit, which causes indicatif's progress output to render as raw ANSI escape sequences duringprek install.Re-enables VT mode after subprocess
output()andstatus()calls to restore console state before prek resumes its own output.Fixes #1237