Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical scrolling duplicates last ran command #4812

Closed
thnk2wn opened this issue Mar 5, 2020 · 15 comments
Closed

Vertical scrolling duplicates last ran command #4812

thnk2wn opened this issue Mar 5, 2020 · 15 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@thnk2wn
Copy link

thnk2wn commented 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

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 5, 2020
@zadjii-msft
Copy link
Member

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?

@thnk2wn
Copy link
Author

thnk2wn commented 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

@zadjii-msft
Copy link
Member

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?

@thnk2wn
Copy link
Author

thnk2wn commented 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
Copy link
Author

thnk2wn commented 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
Copy link
Author

thnk2wn commented Mar 5, 2020

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

@cosm1c-serpent

This comment has been minimized.

@DHowett-MSFT
Copy link
Contributor

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 DHowett-MSFT added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. labels Mar 5, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 5, 2020
@thnk2wn
Copy link
Author

thnk2wn commented 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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 6, 2020
@DHowett-MSFT
Copy link
Contributor

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. 😄

@thnk2wn
Copy link
Author

thnk2wn commented 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
Copy link
Author

thnk2wn commented 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.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented 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 DHowett-MSFT added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Mar 27, 2020
@thnk2wn
Copy link
Author

thnk2wn commented 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.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 30, 2020
@DHowett-MSFT DHowett-MSFT added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Apr 10, 2020
@DHowett-MSFT
Copy link
Contributor

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 DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 10, 2020
@DHowett-MSFT DHowett-MSFT removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

4 participants