terminal: Malformed/Partially destroyed Standard output from Visual studio (& others)

Windows Terminal version

1.15.2875.0

Windows build number

10.0.22000.1281

Other Software

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.4.2

Steps to reproduce

  1. In Windows Settings, Windows Terminal should be set as default terminal.
  2. In Visual Studio, create new C++ project, with arbitrary name
  3. In arbitrary named .cpp file, insert this sample code:
#include <iostream>

int main() {	
	for(int i = 0; i < 100; ++i) {
		std::cout << i << '\n';

	}
	return 0;
}
  1. Set Release and x64 mode.
  2. Click on “Start Without Debugging” button.
  3. Close the terminal.
  4. Click on “Start Without Debugging” button again.
  5. Scroll up.

Expected Behavior

I would expect to see previous output lines correctly when I scroll up.

Actual Behavior

There is no output above the previously visible text, or the output is malformed. bug1

Note: Classic console works as expected in this scenario.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 24 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@zadjii-msft I have the same bug. A simple for loop to print 100 lines will show the first 70 empty (only the ones now in view of the final frame of the console mind you, running it at 120x30, if I increase the height it displays it more correctly to a point).

image

Only with the Windows Terminal, not reproducible choosing Windows Console Host as the default. Only happens at the beginning of the program, if I print 10,000 lines the bug affects the first few hundred.

Tried to reset settings.json to no avail. Reproducible in VStudio, CLion, Codeblocks with msvc, gcc and clang. Not reproducible if debugging.