Random lines of text missing from terminal #14909

Closed
opened 2026-01-31 04:22:54 +00:00 by claunia · 13 comments
Owner

Originally created by @iMoD1998 on GitHub (Aug 20, 2021).

Windows Terminal version (or Windows build number)

22000.160, 1.10.1933.0

Other Software

No response

Steps to reproduce

Unsure how to reproduce.

Expected Behavior

Display all text output.

Actual Behavior

Large amount of lines just randomly dont appear in the terminal from apps that print alot of text.

Take a simple C++ app that does this:

int main( )
{
	for ( int i = 0; i < 300; ++i )
	{
		printf( "Num: %i\n", i );
	}

	return 0;
}

Produces this output:

image
image

Originally created by @iMoD1998 on GitHub (Aug 20, 2021). ### Windows Terminal version (or Windows build number) 22000.160, 1.10.1933.0 ### Other Software _No response_ ### Steps to reproduce Unsure how to reproduce. ### Expected Behavior Display all text output. ### Actual Behavior Large amount of lines just randomly dont appear in the terminal from apps that print alot of text. Take a simple C++ app that does this: ```cpp int main( ) { for ( int i = 0; i < 300; ++i ) { printf( "Num: %i\n", i ); } return 0; } ``` Produces this output: ![image](https://user-images.githubusercontent.com/16210252/130155316-4ef672eb-b0f7-4ae3-b43f-8f5660182927.png) ![image](https://user-images.githubusercontent.com/16210252/130155334-48188d3f-a111-4d82-a4f8-5608e81732c8.png)
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 04:22:55 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 20, 2021):

Thanks for the report! This sounds suspiciously similar to /dup https://github.com/PowerShell/PSReadLine/issues/724

The old version of PSReadline that came with Windows PowerShell uses a "hard scroll" operation when the prompt is displayed. This "hard scroll" deletes the content that was scrolled off the screen.

If you can update PSReadline -- or perhaps even better -- upgrade to PowerShell 7, this issue should be thoroughly defeated. 😄

@DHowett commented on GitHub (Aug 20, 2021): Thanks for the report! This sounds suspiciously similar to /dup https://github.com/PowerShell/PSReadLine/issues/724 The old version of PSReadline that came with Windows PowerShell uses a "hard scroll" operation when the prompt is displayed. This "hard scroll" deletes the content that was scrolled off the screen. If you can update PSReadline -- or perhaps even better -- upgrade to PowerShell 7, this issue should be thoroughly defeated. :smile:
Author
Owner

@ghost commented on GitHub (Aug 20, 2021):

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

@ghost commented on GitHub (Aug 20, 2021): Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!
Author
Owner

@DHowett commented on GitHub (Aug 20, 2021):

You know what, I misread this. Sorry! Reopening for reevaluation.

@DHowett commented on GitHub (Aug 20, 2021): You know what, I misread this. Sorry! Reopening for reevaluation.
Author
Owner

@zadjii-msft commented on GitHub (Aug 23, 2021):

I think I've got an idea.
image
How are you running your program here? Are you launching it from Visual Studio, and relying on the "default terminal" functionality to automatically create a Windows Terminal window, instead of a vintage console window?

@zadjii-msft commented on GitHub (Aug 23, 2021): I think I've got an idea. ![image](https://user-images.githubusercontent.com/18356694/130474072-25992ec2-3ae3-4bb3-b84a-586678111b3a.png) How are you running your program here? Are you launching it from Visual Studio, and relying on the "default terminal" functionality to automatically create a Windows Terminal window, instead of a vintage console window?
Author
Owner

@iMoD1998 commented on GitHub (Aug 24, 2021):

It happens regardless of how it was launched. This was just a quick example. This also happens when using ssh and doing apt upgrades as alot of text is printed fast.

@iMoD1998 commented on GitHub (Aug 24, 2021): It happens regardless of how it was launched. This was just a quick example. This also happens when using ssh and doing apt upgrades as alot of text is printed fast.
Author
Owner

@iMoD1998 commented on GitHub (Aug 28, 2021):

Another example with WSL.

image

@iMoD1998 commented on GitHub (Aug 28, 2021): Another example with WSL. ![image](https://user-images.githubusercontent.com/16210252/131209724-9884eefa-d4b9-42ee-a209-80fe0cdced8b.png)
Author
Owner

@iMoD1998 commented on GitHub (Aug 28, 2021):

I think I've managed to narrow it down to powershell/cmd windows only being the root issue.

For example:
Launch powershell or cmd window
Print a lot of lines fast
It will break terminal by not showing blocks of text
Anything else spawned in that terminal will now also be broken including WSL

So it seems WSL wont break it on its own.

@iMoD1998 commented on GitHub (Aug 28, 2021): I think I've managed to narrow it down to powershell/cmd windows only being the root issue. For example: Launch powershell or cmd window Print a lot of lines fast It will break terminal by not showing blocks of text Anything else spawned in that terminal will now also be broken including WSL So it seems WSL wont break it on its own.
Author
Owner

@zadjii-msft commented on GitHub (Aug 30, 2021):

Hmm. This is me going out on a limb, but do you have anything in you PowerShell profile? I think it's profile.ps1 (but I'm not very fluent in PowerShell, so that might be wrong)

@zadjii-msft commented on GitHub (Aug 30, 2021): Hmm. This is me going out on a limb, but do you have anything in you PowerShell profile? I think it's `profile.ps1` (but I'm not very fluent in PowerShell, so that might be wrong)
Author
Owner

@iMoD1998 commented on GitHub (Sep 1, 2021):

I haven't changed anything in my PowerShell profile and I've reinstalled terminal multiple times and deleted configs to see if it was something to do with that but no luck.

The only thing that has been constant is apps running in cmd or PowerShell that print a lot of text fast seem to cause the issue.

I don't think its a rendering bug as the "invisible text" when copied to clipboard is just a bunch of newlines.

Might try reinstall Windows 11 to see if its just a oddly specific bug with my install.

@iMoD1998 commented on GitHub (Sep 1, 2021): I haven't changed anything in my PowerShell profile and I've reinstalled terminal multiple times and deleted configs to see if it was something to do with that but no luck. The only thing that has been constant is apps running in cmd or PowerShell that print a lot of text fast seem to cause the issue. I don't think its a rendering bug as the "invisible text" when copied to clipboard is just a bunch of newlines. Might try reinstall Windows 11 to see if its just a oddly specific bug with my install.
Author
Owner

@zadjii-msft commented on GitHub (Sep 1, 2021):

That's so peculiar. My theory is that the conpty buffer and the Terminal buffer aren't the same size, but there's seemingly nothing causing that (especially if it repros in cmd profiles, not only powershell ones).

In a powershell profile where this is happening, could you run $Host.UI.RawUI.BufferSize?

And just to be absolutely sure, you're not running this via the Default Terminal setting
image

correct? You're launching wt.exe, then that's spawning cmd.exe, not the other way around?

@zadjii-msft commented on GitHub (Sep 1, 2021): That's so peculiar. My theory is that the conpty buffer and the Terminal buffer aren't the same size, but there's seemingly nothing causing that (especially if it repros in `cmd` profiles, not only powershell ones). In a powershell profile where this is happening, could you run `$Host.UI.RawUI.BufferSize`? And just to be absolutely sure, you're not running this via the Default Terminal setting ![image](https://user-images.githubusercontent.com/18356694/131690145-382d820b-f439-4c64-81fd-970d388afd48.png) correct? You're launching `wt.exe`, then that's spawning `cmd.exe`, not the other way around?
Author
Owner

@iMoD1998 commented on GitHub (Sep 4, 2021):

Uhhhhm...

Just updated to latest windows 11 build 22449.1000 also updated terminal to 1.11.24210 and the issue seems to resolved itself as far as I have tested.

Can keep this issue open for a few days to see if its actually fixed, so far its persisted across reboots.

Also, when I was having the issue I tried launching it both with cmd and wt.

@iMoD1998 commented on GitHub (Sep 4, 2021): Uhhhhm... Just updated to latest windows 11 build 22449.1000 also updated terminal to 1.11.24210 and the issue seems to resolved itself as far as I have tested. Can keep this issue open for a few days to see if its actually fixed, so far its persisted across reboots. Also, when I was having the issue I tried launching it both with cmd and wt.
Author
Owner

@iMoD1998 commented on GitHub (Sep 7, 2021):

Seems issue has resolved itself.

@iMoD1998 commented on GitHub (Sep 7, 2021): Seems issue has resolved itself.
Author
Owner

@DHowett commented on GitHub (Sep 7, 2021):

Wild! Thank you for closing the loop here 😄

@DHowett commented on GitHub (Sep 7, 2021): Wild! Thank you for closing the loop here :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14909