Closed jnm2 closed 11 months ago
This may be a duplicate of #16212. Looks like the common element is setting .NET's Console.BufferHeight, which is a platform call to https://learn.microsoft.com/en-us/windows/console/setconsolescreenbuffersize.
More info: if you resize the Windows Terminal window after the buffer size is changed, it will not proceed to crash once the output starts scrolling the window.
There are no crashes in 1.19.3172.01 Tried it in two ways:
$code = @"
using System;
public static class Program
{
public static void Main()
{
Console.BufferHeight = 500;
for (var i = 1; i < 100; i++)
{
Console.WriteLine(i.ToString());
}
}
}
"@
Add-Type -TypeDefinition $code
[Program]::Main()
[console]::BufferHeight = 500
for ($i = 1; $i -lt 100; $i++) { [console]::WriteLine($i.ToString()) }
Cool. Those both repros worked to cause the crash in the older version, I just double-checked. Any idea what commit fixed this?
Yea we're gonna mark this as /dup #16199. Thanks for the neat, minimal repros!
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Windows Terminal version
1.18.2822.0
Windows build number
10.0.22631.2428
Other Software
No response
Steps to reproduce
Compile and run the following .NET program. Reproed on both .NET Core/6 and .NET Framework, as expected.
Expected Behavior
No crash
Actual Behavior
Crashes to desktop, and the .NET process subsequently crashes on Console.WriteLine with System.IO.IOException: 'No process is on the other end of the pipe.' (.NET 8 doesn't crash on WriteLine, but WindowsTerminal.exe still crashes to desktop.)
When I attach a debugger to WindowsTerminal.exe and run the app, this is the exception: