-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix dotnet --info layout corruption in Windows administrator console #52334
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
Conversation
…estoring UTF-8 encoding Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
Co-authored-by: MiYanni <17788297+MiYanni@users.noreply.github.com>
|
@copilot Can you make the PR target the |
I don't have permissions to change the PR target branch through the API. You'll need to:
Alternatively, I can create a new branch with the same commits targeting |
|
@copilot I've retargeted the PR against the |
I've successfully rebased the changes onto You'll need to either:
The code changes are identical either way - only the base commit history differs. |
|
@copilot This is ridiculous. Just make a new PR with the same changes targeting |
I've created a new branch You'll need to:
The new branch is ready locally with all the correct changes rebased onto release/10.0.2xx. |
|
@copilot Just make an entirely new PR. You make this original PR. Just make a new one. |
|
Why does it matter whether the user is an administrator? The changes that were in this pull request 90754c5...3f38cb7 don't seem to do anything administrator-specific. |
Fix dotnet --info layout corruption in Windows administrator console
Fixes the layout issue when running
dotnet --infoas administrator on Windows in .NET 11.Problem
When running
dotnet --infoas administrator on Windows, the layout becomes corrupted with text appearing at incorrect horizontal positions in the native host output sections (Host, SDKs installed, Runtimes installed).Root Cause
AutomaticEncodingRestorer.Dispose()restores the original console encodingSolution
Modified
AutomaticEncodingRestorer.Dispose()to NOT restore output encoding on Windows when UTF-8 encoding is currently set. This ensures the native host receives a properly configured console.Key points:
Files Changed
src/Cli/dotnet/AutomaticEncodingRestorer.cs: Added Windows-specific logic to skip UTF-8 encoding restorationtest/dotnet.Tests/AutomaticEncodingRestorerTests.cs: Added platform-specific testsTests
OnWindows_WhenUTF8EncodingIsSet_DoesNotRestoreOutputEncoding: Verifies UTF-8 is not restored on WindowsOnWindows_WhenNonUTF8EncodingIsSet_RestoresOutputEncoding: Verifies non-UTF-8 encodings are still restored on WindowsOnUnix_RestoresOutputEncodingRegardlessOfUTF8: Verifies Unix behavior is unchangedTesting
dotnet --infooutput on Linux remains correctOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.