Skip to content

GetLargestConsoleWindowSize returns incorrect size in Terminal #10337

@alabuzhev

Description

@alabuzhev

Windows Terminal version (or Windows build number)

1.9.1445.0

Other Software

No response

Steps to reproduce

Compile and run the following code:

#include <iostream>
#include <windows.h>

int main()
{
	COORD c = GetLargestConsoleWindowSize(GetStdHandle(STD_OUTPUT_HANDLE));
	std::cout << "\nWidth:  " << c.X << "\nHeight: " << c.Y << std::endl;
}

Expected Behavior

Some sane output, e.g.

Width:  213
Height: 50

Actual Behavior

Reported width is insanely large:

Width:  1904 
Height: 62

Actual maximum size (maximize the window and type mode con):

> mode con

Status for device CON:
----------------------
    Lines:          47
    Columns:        209

Metadata

Metadata

Assignees

Labels

Product-ConhostFor issues in the Console codebaseResolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions