Implement Console.SetWindowSize() for linux
Implement Console.SetWindowSize() using the same system call with ConsoleGetWindowSize() (ioctl w/ set param TIOCSWINSZ).
Note regarding the new-api-needs-documentation label:
This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.
Tagging subscribers to this area: @dotnet/area-system-console See info in area-owners.md if you want to be subscribed.
Issue Details
Implement Console.SetWindowSize() using the same system call with ConsoleGetWindowSize() (ioctl w/ set param TIOCSWINSZ).
| Author: | HJLeee |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
@stephentoub Would you review this please?
Hi, Thank you for the testcase and review.
Which Terminal have you used for testing?
I've used my ubuntu 22.04 with screen-256color TERM and checked effectiveness with nvim as below.
You can see nvim uses the value I set for testing.
· ~/dotnet/tests/winsize $ cat Program.cs
// See https://aka.ms/new-console-template for more information
Console.SetWindowSize(80,30);
Console.WriteLine("Width: {0}, Height: {1}", Console.WindowWidth, Console.WindowHeight);
Rebased and force pushed to resolve conflict.
src/libraries/apicompat/ApiCompat.proj(50,5): error CP0014: (NETCORE_ENGINEERING_TELEMETRY=Build) Cannot remove attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")' from 'System.Console.WindowHeight.get'.
@ViktorHofer we want to introduce this change on purpose, what is needed to make the CI green in such case?
Replied offline:
You will need to add the compatibility difference to the suppression file that is used when comparing net7.0 against net6.0: runtime/ApiCompatBaseline.NetCoreAppLatestStable.xml at main · dotnet/runtime (github.com). You can either hand-edit it or use the following command to update it: dotnet.cmd src/libraries/apicompat --no-dependencies /p:GenerateCompatibilitySuppressionFile=true
@ViktorHofer I've done that and pushed the changes. I can perform a full clean build now (build -c Release -subset clr+libs+libs.tests) on both Windows and Linux, but the CI is still failing with the old error message (before the fix I was getting the same error locally). Do you have any idea why?
@ViktorHofer I've done that and pushed the changes. I can perform a full clean build now (build -c Release -subset clr+libs+libs.tests) on both Windows and Linux, but the CI is still failing with the old error message (before the fix I was getting the same error locally). Do you have any idea why?
Looking now
The build is passing for me locally as well and I diffed the binlogs from the failing run and the local one. There aren't any differences that would explain this behavior.
After spending some time on it, I just noticed that CI wasn't triggered for your commit :(
/azp run dotnet-linker-tests
/azp run runtime-dev-innerloop
Azure Pipelines successfully started running 1 pipeline(s).
/azp run runtime
Azure Pipelines successfully started running 1 pipeline(s).
/azp run runtime-staging
Azure Pipelines successfully started running 1 pipeline(s).
Azure Pipelines successfully started running 1 pipeline(s).
Wow. Thank you for APICompat and CI stuff. 😄