-
Notifications
You must be signed in to change notification settings - Fork 291
Fix cursor positioning when Console.BufferWidth exceeds Console.WindowWidth #7305
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: main
Are you sure you want to change the base?
Conversation
…l positioning Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
...ests/Microsoft.Testing.Platform.UnitTests/OutputDevice/Terminal/TerminalTestReporterTests.cs
Outdated
Show resolved
Hide resolved
...ests/Microsoft.Testing.Platform.UnitTests/OutputDevice/Terminal/TerminalTestReporterTests.cs
Outdated
Show resolved
Hide resolved
...ests/Microsoft.Testing.Platform.UnitTests/OutputDevice/Terminal/TerminalTestReporterTests.cs
Outdated
Show resolved
Hide resolved
| @@ -507,6 +507,10 @@ internal class StringBuilderConsole : IConsole | |||
|
|
|||
| public int BufferWidth => int.MinValue; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks weird, looks like a typo, probably should have been MaxValue? Interesting that the current tests (before this change) work.
|
|
||
| public int WindowHeight => int.MaxValue; | ||
|
|
||
| public int WindowWidth => 120; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be MaxValue as well, as it limits the size of the screen and we probably don't want to test shortening in any of the general test cases.
When
Console.BufferWidthis set larger thanConsole.WindowWidth, test progress timings display incorrectly or not at all. MTP uses ANSI cursor positioning to place timings on the right edge, but was calculating positions usingBufferWidthinstead ofWindowWidth.Changes
IConsole interface
WindowWidthandWindowHeightpropertiesTerminal implementations
SimpleTerminalandAnsiTerminalnow useWindowWidth/WindowHeightinstead ofBufferWidth/BufferHeightfor theirWidth/HeightpropertiesTests
SimpleTerminal_UsesWindowWidthNotBufferWidthandAnsiTerminal_UsesWindowWidthNotBufferWidthto verify behavior when buffer ≠ window dimensionsExample scenario
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
5rqvsblobprodcus385.vsblob.vsassets.io/home/REDACTED/work/testfx/testfx/.dotnet/dotnet /home/REDACTED/work/testfx/testfx/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/testfx/testfx/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/testfx/testfx/artifacts/toolset/11.0.0-beta.26077.1.txt(dns block)/usr/bin/dotnet dotnet build src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj -c Release kload.emscripten.net9(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original 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.