Previous command disappears from the terminal output when it fills the current terminal height #17130

Closed
opened 2026-01-31 05:32:58 +00:00 by claunia · 9 comments
Owner

Originally created by @danilaml on GitHub (Apr 1, 2022).

Windows Terminal version

1.11.3471.0

Windows build number

10.0.19043.0

Other Software

No response

Steps to reproduce

I've first discovered this issue in VS Code and described it (with the gifs and steps to reproduce) here: https://github.com/microsoft/vscode/issues/146450
I was able to reproduce it in the latest Windows Terminal.

Expected Behavior

When scrolling back the command output is delimited by the commands themselves.
image

Actual Behavior

The problematic command disappears from the output, "merging" the two commands stdout together (in the images below the output after the empty line was generated by python -c "print('foo\n' * 27)").
image
image

Originally created by @danilaml on GitHub (Apr 1, 2022). ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.19043.0 ### Other Software _No response_ ### Steps to reproduce I've first discovered this issue in VS Code and described it (with the gifs and steps to reproduce) here: https://github.com/microsoft/vscode/issues/146450 I was able to reproduce it in the latest Windows Terminal. ### Expected Behavior When scrolling back the command output is delimited by the commands themselves. ![image](https://user-images.githubusercontent.com/2046350/161256507-bbdb2b6d-b099-405c-ba6d-6491f6447f06.png) ### Actual Behavior The problematic command disappears from the output, "merging" the two commands stdout together (in the images below the output after the empty line was generated by `python -c "print('foo\n' * 27)"`). ![image](https://user-images.githubusercontent.com/2046350/161256642-baacfbf5-8c7a-4fa7-ad34-7538a3d4cd63.png) ![image](https://user-images.githubusercontent.com/2046350/161255838-bbb56806-764c-43e6-a4ba-09bfa1dfb734.png)
Author
Owner

@zadjii-msft commented on GitHub (Apr 1, 2022):

What do you have in your PowerShell profile?

@zadjii-msft commented on GitHub (Apr 1, 2022): What do you have in your PowerShell profile?
Author
Owner

@danilaml commented on GitHub (Apr 1, 2022):

@zadjii-msft path returned by $profile doesn't seem to exist so I assume nothing. Note, that I wasn't able to reproduce this issue in the standalone powershell (makes sense, if it's conpty issue). I've tested on two different machines too (same Win version).

@danilaml commented on GitHub (Apr 1, 2022): @zadjii-msft path returned by `$profile` doesn't seem to exist so I assume nothing. Note, that I wasn't able to reproduce this issue in the standalone powershell (makes sense, if it's conpty issue). I've tested on two different machines too (same Win version).
Author
Owner

@zadjii-msft commented on GitHub (Aug 12, 2022):

This is crazy, and I can't seem to repro this at all, despite the repro steps being pretty straightforward. If this were a conpty issue, then maybe we fixed it between 1.11 and 1.15? But nothing immediately comes to mind...

@zadjii-msft commented on GitHub (Aug 12, 2022): This is crazy, and I can't seem to repro this at all, despite the repro steps being pretty straightforward. If this were a conpty issue, then maybe we fixed it between 1.11 and 1.15? But nothing immediately comes to mind...
Author
Owner

@danilaml commented on GitHub (Aug 12, 2022):

I can still reproduce it in Terminal 1.14.1962.0 (and different versions of VS Code) and Windows 10.0.19044.0 on several machines. Make sure that the output of the command is exactly long enough for the executed command to be at the topmost line after it's done.

@danilaml commented on GitHub (Aug 12, 2022): I can still reproduce it in Terminal 1.14.1962.0 (and different versions of VS Code) and Windows 10.0.19044.0 on several machines. Make sure that the output of the command is exactly long enough for the executed command to be at the topmost line after it's done.
Author
Owner

@zadjii-msft commented on GitHub (Aug 15, 2022):

Maybe it's a timing thing then? Cause I couldn't get this to repro even on a 1.10 build of the Terminal. Maybe it really needs all the output to come in a single conpty frame, and my hardware is just too fast for that.

@zadjii-msft commented on GitHub (Aug 15, 2022): Maybe it's a timing thing then? Cause I couldn't get this to repro even on a 1.10 build of the Terminal. Maybe it really needs all the output to come in a single conpty frame, and my hardware is just too fast for that.
Author
Owner

@danilaml commented on GitHub (Aug 15, 2022):

Are you testing on Win10? Is HW acceleration enabled (I haven't verified that it is or not in my case, but I assume it's the same across the board since I haven't changed any defaults)? There is no timing at play, as far as I can tell. I can wait 10-15 seconds between running commands and the result is the same. The reproducibility rate is 100%. I've also run it on 3 reasonably powerful machines (2-core HT ultrabook, 6-core HT laptop and 4-core Desktop). Is there anything else I can provide to help move this issue?

@danilaml commented on GitHub (Aug 15, 2022): Are you testing on Win10? Is HW acceleration enabled (I haven't verified that it is or not in my case, but I assume it's the same across the board since I haven't changed any defaults)? There is no timing at play, as far as I can tell. I can wait 10-15 seconds between running commands and the result is the same. The reproducibility rate is 100%. I've also run it on 3 reasonably powerful machines (2-core HT ultrabook, 6-core HT laptop and 4-core Desktop). Is there anything else I can provide to help move this issue?
Author
Owner

@zadjii-msft commented on GitHub (Aug 9, 2023):

Hey we think this might be a known issue in older versions of PsReadline: https://github.com/PowerShell/PSReadLine/issues/724

Does this repro if you Remove-Module PsReadline (or update it) (or just run the command from a Command Prompt profile)/?

I can't believe I didn't catch that before!

@zadjii-msft commented on GitHub (Aug 9, 2023): Hey we think this might be a known issue in older versions of PsReadline: https://github.com/PowerShell/PSReadLine/issues/724 Does this repro if you `Remove-Module PsReadline` (or update it) (or just run the command from a Command Prompt profile)/? I can't believe I didn't catch that before!
Author
Owner

@danilaml commented on GitHub (Aug 9, 2023):

@zadjii-msft hi. PSReadline seems to be impossible to remove from my machine (or to cleanly update due to name change for that matter) and I don't know if I can safely delete its folder in C:\Program Files\WindowsPowerShell\Modules but after I've installed 2.2.6 side-by-side it seems to have gone away (unable to reproduce).

@danilaml commented on GitHub (Aug 9, 2023): @zadjii-msft hi. PSReadline seems to be impossible to remove from my machine (or to cleanly update due to name change for that matter) and I don't know if I can safely delete its folder in `C:\Program Files\WindowsPowerShell\Modules` but after I've installed 2.2.6 side-by-side it seems to have gone away (unable to reproduce).
Author
Owner

@zadjii-msft commented on GitHub (Aug 9, 2023):

Well that sure is wacky! Alas, I'm not the powershell expert so I can't help with that, but hey, glad it went away?

@zadjii-msft commented on GitHub (Aug 9, 2023): Well that sure is wacky! Alas, I'm not the powershell expert so I can't help with that, but hey, glad it went away?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17130