Console.LargestWindowWidth report wrong width #18176

Open
opened 2026-01-31 06:05:56 +00:00 by claunia · 0 comments
Owner

Originally created by @MrM40 on GitHub (Aug 14, 2022).

Windows Terminal version

1.15.220719002-preview (and 1.13.2202)

Windows build number

10.0.19043.1466

Other Software

No response

Steps to reproduce

When I call Console.LargestWindowWidth in .NET 6 I get a wrong width.
image

On legacy console and VS debug console I get a correct number:
image

Documentation says:
"Gets the largest possible number of console window columns, based on the current font and screen resolution."
It seems it report pixels and not columns?

My primary screen is 1920x1080 and .LargestWindowWidth report 1904.
I Changed the resolution to 1680x1050 and now it report 1664.

Not sure if this is related to Windows Terminal or .NET
Strange legacy console and VS Debug console behave different, which make me think it's related to Windows Terminal.

Expected Behavior

No response

Actual Behavior

..

Originally created by @MrM40 on GitHub (Aug 14, 2022). ### Windows Terminal version 1.15.220719002-preview (and 1.13.2202) ### Windows build number 10.0.19043.1466 ### Other Software _No response_ ### Steps to reproduce When I call `Console.LargestWindowWidth` in .NET 6 I get a wrong width. ![image](https://user-images.githubusercontent.com/16258063/184554060-b8187be1-f42a-41aa-b9b8-06f9547e28a6.png) On legacy console and VS debug console I get a correct number: ![image](https://user-images.githubusercontent.com/16258063/184554072-f09a9084-d949-4bdc-b28b-3945cc5e74cb.png) Documentation says: "Gets the largest possible number of console window columns, based on the current font and screen resolution." It seems it report pixels and not columns? My primary screen is 1920x1080 and .LargestWindowWidth report 1904. I Changed the resolution to 1680x1050 and now it report 1664. Not sure if this is related to Windows Terminal or .NET Strange legacy console and VS Debug console behave different, which make me think it's related to Windows Terminal. ### Expected Behavior _No response_ ### Actual Behavior ..
claunia added the Needs-TriageIssue-BugNeeds-Tag-Fix labels 2026-01-31 06:05:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18176