Repository navigation
Closed
Labels
Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Down in the muck of API call servicing, interprocess communication, eventing, etc.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-ConptyFor console issues specifically related to conptyFor console issues specifically related to conptyResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.Severity-CrashCrashes are real bad news.Crashes are real bad news.
Milestone
Description
- A pseudoconsole host is a headless console
- Headless consoles have no minimum size
SetConsoleScreenBufferSize(new)checks to make sure the following are true:newis within minimum sizenewis within current viewport size
SetConsoleScreenBufferSizeonly does this check if a console is headful (i.e. not headless)
Lines 509 to 519 in 381b115
| if (!ServiceLocator::LocateGlobals().IsHeadless()) | |
| { | |
| COORD const coordMin = screenInfo.GetMinWindowSizeInCharacters(); | |
| // clang-format off | |
| // Make sure requested screen buffer size isn't smaller than the window. | |
| RETURN_HR_IF(E_INVALIDARG, (size.X < screenInfo.GetViewport().Width() || | |
| size.Y < screenInfo.GetViewport().Height() || | |
| size.Y < coordMin.Y || | |
| size.X < coordMin.X)); | |
| // clang-format on | |
| } |
- When we're attached to a conpty, it happily resizes the buffer to be smaller than the viewport.
- The next time the whole screen is invalidated (or whenever luck strikes, really), the renderer tries to render the whole viewport, which is now outside the bounds of the buffer.
This part of the check should probably be moved outside of the "are we headful" block;
Lines 514 to 515 in 381b115
| RETURN_HR_IF(E_INVALIDARG, (size.X < screenInfo.GetViewport().Width() || | |
| size.Y < screenInfo.GetViewport().Height() || |
Trivial repro code:
#include <Windows.h>
int main(int argc, char *argv[])
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleScreenBufferSize(hStdOut, {10,10});
return 0;
}This purchases a nice plot of land overlooking a cemetery for both WSL interop and Windows Terminal. 😄
Metadata
Metadata
Assignees
Labels
Area-ServerDown in the muck of API call servicing, interprocess communication, eventing, etc.Down in the muck of API call servicing, interprocess communication, eventing, etc.Issue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Needs-Tag-FixDoesn't match tag requirementsDoesn't match tag requirementsProduct-ConptyFor console issues specifically related to conptyFor console issues specifically related to conptyResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.Severity-CrashCrashes are real bad news.Crashes are real bad news.
Activity
[-]SetConsoleScreenBufferSize(something < viewport) crashes contpy host[/-][+]SetConsoleScreenBufferSize(something < viewport) crashes PTY host[/+][-]SetConsoleScreenBufferSize(something < viewport) crashes PTY host[/-][+]SetConsoleScreenBufferSize(something < viewport) crashes ConPTY host[/+]zadjii-msft commentedon Dec 12, 2019