Vertical scrolling duplicates last ran command #6750

Closed
opened 2026-01-31 00:46:23 +00:00 by claunia · 15 comments
Owner

Originally created by @thnk2wn on GitHub (Mar 5, 2020).

Environment

Windows build number:  Microsoft Windows NT 10.0.19041.0
Windows Terminal version (if applicable): 0.9.433.0

Any other software? Recently installed PowerShell 7

Steps to reproduce

I recently updated to PowerShell 7. I'm assuming that's related but not sure.

I ran a command like az iot hub device-identity create --hub-name myHub --device-id MyDevice --edge-enabled and then scrolled down to see output.

Expected behavior

I see both the command I ran (once) and the output.

Actual behavior

Afterwards when I scroll, I see the command I ran multiple times even though I only ran the command once. It seems to almost "dock" to the top somewhat but it's jumpy and is usually show more than one time.

image

Originally created by @thnk2wn on GitHub (Mar 5, 2020). # Environment ```none Windows build number: Microsoft Windows NT 10.0.19041.0 Windows Terminal version (if applicable): 0.9.433.0 Any other software? Recently installed PowerShell 7 ``` # Steps to reproduce I recently updated to PowerShell 7. I'm assuming that's related but not sure. I ran a command like `az iot hub device-identity create --hub-name myHub --device-id MyDevice --edge-enabled` and then scrolled down to see output. # Expected behavior I see both the command I ran (once) and the output. # Actual behavior Afterwards when I scroll, I see the command I ran multiple times even though I only ran the command once. It seems to almost "dock" to the top somewhat but it's jumpy and is usually show more than one time. ![image](https://user-images.githubusercontent.com/120529/75992530-19f14800-5ec6-11ea-9b9e-7dcb6aad3c40.png)
claunia added the Area-OutputResolution-Fix-CommittedIssue-BugProduct-Terminal labels 2026-01-31 00:46:23 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 5, 2020):

That's definitely weird.

  1. What version of PSReadline are you running? Does this repro without PSReadline enabled?
  2. For my own sanity, did you resize your terminal at all?
@zadjii-msft commented on GitHub (Mar 5, 2020): That's definitely weird. 1. What version of PSReadline are you running? Does this repro without PSReadline enabled? 2. For my own sanity, did you resize your terminal at all?
Author
Owner

@thnk2wn commented on GitHub (Mar 5, 2020):

@zadjii-msft

  1. Sorry I'm not really familiar with PSReadLine. How do I determine version and toggle enabled status?

  2. I don't think I resized the terminal at all. It started in a non-maximized state and I'm pretty sure I didn't resize it before this happened.

I did try to reproduce this some by running similar commands and via resizing terminal. While I didn't exactly reproduce what happened originally, I was able to somewhat reproduce something similar with something similar to this

  1. Start terminal non-maximized.
  2. Run a command like az iot hub device-identity create or something that'll generate some longer json output or similar
  3. Type clear, hit Enter
  4. Scroll up with mouse wheel, notice that previous output shows up even though console was cleared (this doesn't happen for 'normal' commands like ls)
  5. With that previous output shown after clear, hit up arrow and re-run the command
  6. Part of the previously cleared input / output that wasn't quite cleared shows up, along with the new input / output
@thnk2wn commented on GitHub (Mar 5, 2020): @zadjii-msft 1. Sorry I'm not really familiar with `PSReadLine`. How do I determine version and toggle enabled status? 2. I don't think I resized the terminal at all. It started in a non-maximized state and I'm pretty sure I didn't resize it before this happened. I did try to reproduce this some by running similar commands and via resizing terminal. While I didn't exactly reproduce what happened originally, I was able to somewhat reproduce something similar with something similar to this 1. Start terminal non-maximized. 2. Run a command like `az iot hub device-identity create` or something that'll generate some longer json output or similar 3. Type `clear`, hit Enter 4. Scroll up with mouse wheel, notice that previous output shows up even though console was cleared (this doesn't happen for 'normal' commands like ls) 5. With that previous output shown after clear, hit up arrow and re-run the command 6. Part of the previously cleared input / output that wasn't quite cleared shows up, along with the new input / output
Author
Owner

@zadjii-msft commented on GitHub (Mar 5, 2020):

Get-Module PSReadline Should return something like:

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     2.0.0      PSReadline                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...}

I'm currently working on a whole host of resizing bugs right now so I just wanted a quick sanity check if this is a part of that. Since you didn't, then I can pretty safely assume it's not part of that bucket and it's something else entirely.

There's other clear issues running around, esp. "notice that previous output shows up even though console was cleared (this doesn't happen for 'normal' commands like ls)", but then you said

With that previous output shown after clear, hit up arrow and re-run the command
Part of the previously cleared input / output that wasn't quite cleared shows up, along with the new input / output

and that's definitely unique. Maybe the clear implementation changed in PS7?

@zadjii-msft commented on GitHub (Mar 5, 2020): `Get-Module PSReadline` Should return something like: ``` ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 2.0.0 PSReadline {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...} ``` I'm currently working on a whole host of resizing bugs right now so I just wanted a quick sanity check if this is a part of that. Since you didn't, then I can pretty safely assume it's not part of that bucket and it's something else entirely. There's other clear issues running around, esp. "notice that previous output shows up even though console was cleared (this doesn't happen for 'normal' commands like ls)", but then you said > With that previous output shown after clear, hit up arrow and re-run the command > Part of the previously cleared input / output that wasn't quite cleared shows up, along with the new input / output and that's definitely unique. Maybe the `clear` implementation changed in PS7?
Author
Owner

@thnk2wn commented on GitHub (Mar 5, 2020):

pwsh> Get-Module PSReadline

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.0.0                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, …

Regarding clear, I don't think that's related to PS 7. I noticed that before and just chalked it up to the "virtualized" nature of the terminal. Others have reported the same thing i.e. #4445

While attempting to recreate this, clearing the screen and then up arrowing or scrolling and seeing past output did seem to help reproduce it. However I don't recall doing that initially.

@thnk2wn commented on GitHub (Mar 5, 2020): <pre> pwsh> Get-Module PSReadline ModuleType Version PreRelease Name ExportedCommands ---------- ------- ---------- ---- ---------------- Script 2.0.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, … </pre> Regarding clear, I don't think that's related to PS 7. I noticed that before and just chalked it up to the "virtualized" nature of the terminal. Others have reported the same thing i.e. #4445 While attempting to recreate this, clearing the screen and then up arrowing or scrolling and seeing past output did seem to help reproduce it. However I don't recall doing that initially.
Author
Owner

@thnk2wn commented on GitHub (Mar 5, 2020):

@zadjii-msft I can send a video privately on the clear / scrolling issue given input on where / how to send. I'm not positive that's the same issue as originally posted but may be related

@thnk2wn commented on GitHub (Mar 5, 2020): @zadjii-msft I can send a video privately on the clear / scrolling issue given input on where / how to send. I'm not positive that's the same issue as originally posted but may be related
Author
Owner

@thnk2wn commented on GitHub (Mar 5, 2020):

Email with attachment sent to secure@microsoft.com referencing this issue

@thnk2wn commented on GitHub (Mar 5, 2020): Email with attachment sent to secure@microsoft.com referencing this issue
Author
Owner

@cosm1c-serpent commented on GitHub (Mar 5, 2020):

vertical scrolling need to implemented.

@cosm1c-serpent commented on GitHub (Mar 5, 2020): vertical scrolling need to implemented.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 5, 2020):

Sorry, my team never gets stuff sent to secure@ -- it's an address for reporting security concerns. Would you mind uploading it to OneDrive or something similar?

@DHowett-MSFT commented on GitHub (Mar 5, 2020): Sorry, my team never gets stuff sent to secure@ -- it's an address for _reporting security concerns_. Would you mind uploading it to OneDrive or something similar?
Author
Owner

@thnk2wn commented on GitHub (Mar 6, 2020):

Oh the issue template comments made it sound like any attachment with confidential info could be sent there and linked here. I can upload to OneDrive or similar when back on my box but posting a link to it here is the same problem. It might not have anything concerning to share though, I'll double check later.

@thnk2wn commented on GitHub (Mar 6, 2020): Oh the issue template comments made it sound like any attachment with confidential info could be sent there and linked here. I can upload to OneDrive or similar when back on my box but posting a link to it here is the same problem. It might not have anything concerning to share though, I'll double check later.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 6, 2020):

Oh, i didn't realize our template still said that. Really sorry! If you'd prefer, my work e-mail is on my github profile. 😄

@DHowett-MSFT commented on GitHub (Mar 6, 2020): Oh, i didn't realize our template still said that. Really sorry! If you'd prefer, my work e-mail is on my github profile. :smile:
Author
Owner

@thnk2wn commented on GitHub (Mar 6, 2020):

@DHowett-MSFT Sent. As mentioned the video may be showing a slightly different issue than I originally posted here but perhaps similar or related

@thnk2wn commented on GitHub (Mar 6, 2020): @DHowett-MSFT Sent. As mentioned the video may be showing a slightly different issue than I originally posted here but perhaps similar or related
Author
Owner

@thnk2wn commented on GitHub (Mar 6, 2020):

One other point to mention was that after this happened I also noticed that pasting copied text into the terminal wasn't working either anymore. I closed the Terminal and reopened it after that point. Somehow it seemed to get into a weird state but haven't been able to quite reproduce the exact original behavior.

@thnk2wn commented on GitHub (Mar 6, 2020): One other point to mention was that after this happened I also noticed that pasting copied text into the terminal wasn't working either anymore. I closed the Terminal and reopened it after that point. Somehow it seemed to get into a weird state but haven't been able to quite reproduce the exact original behavior.
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 27, 2020):

@thnk2wn sorry for taking a while on this! I got a chance to dig into your video, and it looks like this is similar (if not identical) to #3126. Things that get pushed off the screen don't end up getting cleared, because Powershell's implementation of "clear" is actually "draw a bunch of empty spaces all over the screen." 😄

Just as a test, if instead of clearing you run...

PS> "`e[2J`e[H`e[3J"

does the clear actually take?

If you're getting a single line hanging over from the last buffer, that'll be #5039. 😄

@DHowett-MSFT commented on GitHub (Mar 27, 2020): @thnk2wn sorry for taking a while on this! I got a chance to dig into your video, and it looks like this is similar (if not identical) to #3126. Things that get pushed off the screen don't end up getting cleared, because Powershell's implementation of "clear" is actually "draw a bunch of empty spaces all over the screen." :smile: Just as a test, if instead of clearing you run... ``` PS> "`e[2J`e[H`e[3J" ``` does the clear actually _take_? If you're getting a single line hanging over from the last buffer, that'll be #5039. :smile:
Author
Owner

@thnk2wn commented on GitHub (Mar 30, 2020):

Thanks @DHowett-MSFT. When I run that command the clear takes and I can't scroll back to prior content like I can with clear.

I'm not sure if what I saw was the same as #5039 or not. It may have been but my original issue and screenshot doesn't quite seem to be the same as either issue but it's hard to say as I can't reproduce it consistently. I guess this can be closed or I can test again if/when either of those potentially related issues are addressed.

@thnk2wn commented on GitHub (Mar 30, 2020): Thanks @DHowett-MSFT. When I run that command the clear takes and I can't scroll back to prior content like I can with clear. I'm not sure if what I saw was the same as #5039 or not. It may have been but my original issue and screenshot doesn't quite seem to be the same as either issue but it's hard to say as I can't reproduce it consistently. I guess this can be closed or I can test again if/when either of those potentially related issues are addressed.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 10, 2020):

I guess this can be closed, or I can test again

Thanks for hanging in there. I'm going to advocate for "both" right now -- I'll close this out in hope that the changes we've made in this area recently helped it, because we just did a whole lot for invalidation and drawing and clearing and all that. Once 0.11 drops, please do file a bug if it keeps hitting. It'll be really great to get to the bottom of it. 😄

@DHowett-MSFT commented on GitHub (Apr 10, 2020): > I guess this can be closed, or I can test again Thanks for hanging in there. I'm going to advocate for "both" right now -- I'll close this out in hope that the changes we've made in this area recently helped it, because we just did a _whole lot_ for invalidation and drawing and clearing and all that. Once 0.11 drops, please do file a bug if it keeps hitting. It'll be really great to get to the bottom of it. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6750