Bug: When headless, GetLargestConsoleWindowSize reports a MUCH too small size #2712
Labels
Area-Server
Down in the muck of API call servicing, interprocess communication, eventing, etc.
Help Wanted
We encourage anyone to jump in on these.
Issue-Bug
It either shouldn't be doing this or needs an investigation.
Priority-2
A description (P2)
Product-Conpty
For console issues specifically related to conpty
Milestone
Environment
In a headless pseudoconsole session (such as over ssh),
GetLargestConsoleWindowSize
is reporting a maximum possible window size of 640 columns and 18 rows (on my particular SKU of Windows, which might differ from others). 640 columns isn't bad, I suppose, but 18 rows is downright tiny. I debugged a bit and found that internally (in conhost) this is due to a "screen" size in pixels of 640x300, and a font size of {1, 16}. (Of course there is not really a screen or pixels in a headless scenario, and that font size seems strange.)Over ssh, I believe the console does not have any way to determine the ssh client's maximum possible window size (it doesn't know the size of the monitor the client is using, or the font being used, or even if it's a windows machine). It can be notified of window size changes on the client side (section 6.7: "Window Dimension Change Message" of RFC 4254), but not what the max possible size is. (Although I know very little about ssh; it's possible there's some extension or convention or something.)
So I propose that since there is no monitor hooked up to a headless session,
GetLargestConsoleWindowSize
should just report{ SHRT_MAX, SHRT_MAX }
(and let the client deal with whatever happens if the client sets the console's size too big).(Without this, vim running in an ssh session is stuck at 18 lines high and cannot be made any bigger.)
The text was updated successfully, but these errors were encountered: