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

Hiding and showing vscode terminal causes the terminal scroll position to reset to top #134692

Closed
aureq opened this issue Oct 9, 2021 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded
Milestone

Comments

@aureq
Copy link

aureq commented Oct 9, 2021

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.61.0
  • OS Version: Windows 10 10.0.19043

Steps to Reproduce:

  1. Launch vscode, with or without extensions enabled
  2. Open a terminal
  3. Run a command that generates many lines (dir C:\Windows\System32)
  4. Note the terminal scrollbar position. It should be at the bottom
  5. Hide the terminal windows using the X icon in the terminal top right corner, or using CTRL+`
  6. Reveal the terminal window using CTRL+`
  7. Note the terminal scrollbar position. It should be at the top. Even though the content displayed is at the bottom
  8. Use your mouse wheel to scroll and the position resets to the top
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues labels Oct 11, 2021
@meganrogge meganrogge added this to the October 2021 milestone Oct 11, 2021
@Tyriar Tyriar added the confirmed Issue has been confirmed by VS Code Team member label Oct 19, 2021
@Tyriar
Copy link
Member

Tyriar commented Oct 22, 2021

Pointer to code that fixed a similar issue in the past:

// Trigger a manual scroll event which will sync the viewport and scroll bar. This is
// necessary if the number of rows in the terminal has decreased while it was in the
// background since scrollTop changes take no effect but the terminal's position does
// change since the number of visible rows decreases.
// This can likely be removed after https://github.com/xtermjs/xterm.js/issues/291 is
// fixed upstream.
this._xtermCore._onScroll.fire(this._xterm.buffer.active.viewportY);

@Tyriar
Copy link
Member

Tyriar commented Oct 22, 2021

Regressed in xtermjs/xterm.js#3205 due to private api changing.

@aureq
Copy link
Author

aureq commented Oct 23, 2021

Thank you folks for fixing this issue. Looking forward to the next release.

@rzhao271 rzhao271 added the verified Verification succeeded label Oct 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2021
@meganrogge meganrogge reopened this Dec 9, 2021
@meganrogge meganrogge removed verified Verification succeeded insiders-released Patch has been released in VS Code Insiders labels Dec 9, 2021
@meganrogge
Copy link
Contributor

Just confirmed this still reproes

@meganrogge meganrogge modified the milestones: October 2021, January 2022 Dec 9, 2021
@meganrogge meganrogge assigned meganrogge and unassigned Tyriar Dec 14, 2021
@tanhakabir tanhakabir added the verified Verification succeeded label Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants
@aureq @Tyriar @rzhao271 @tanhakabir @meganrogge and others