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

Cursor+Scrollbar glitch #5667

Closed
AnuthaDev opened this issue Apr 30, 2020 · 3 comments
Closed

Cursor+Scrollbar glitch #5667

AnuthaDev opened this issue Apr 30, 2020 · 3 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Question For questions or discussion Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered

Comments

@AnuthaDev
Copy link
Contributor

AnuthaDev commented Apr 30, 2020

Environment

Windows build number: 10.0.18363.720
Windows Terminal version (if applicable): 0.11.1191.0

Any other software?
No

Steps to reproduce

  1. Open terminal
  2. Resize window height to minimum.
  3. Increase windows height.

Expected behavior

No scrollbar, The cursor line does not become topmost on entering input:
withoutscroll

Actual behavior

Scrollbar is visible and the line with cursor moves to top on typing:

scrollbottom~2

withscrol~2

@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 Apr 30, 2020
@zadjii-msft
Copy link
Member

So this is an unfortunate side-effect of how the Terminal works. There's essentially a hidden console buffer that the Terminal is rendering, and that buffer is only ever as big as the viewport of the Terminal. So when you decrease the height of the terminal, that text buffer decreases in height as well. That buffer and the Terminal buffer have to stay in sync so that the Terminal won't display any sort of visual corruption, so when the Terminal is resized down to 1 line, the Terminal moves the rest of the buffer content into the history, so it can preserve the contents of the buffer, while still staying in sync with the conpty buffer.

There's an enormous amount of details in #4200, #4741, and #3490. I'd look at those threads more if you want a more detailed explanation of why this path was chosen.

I considered the possibility of having the terminal have a "virtual viewport" that doesn't move on the resize. Then when you resize, our mutable viewport would stay in sync with the conpty viewport, but the "virtual viewport" would stay in the same logical place as before the resize. This however seemed like a bad idea:

  • We've already got experimental support for a virtual viewport in conhost, and that led to a giant pile of bugs, and I'd rather not repeat the same mistakes in the Terminal.
  • When someone uses a VT sequence to move the cursor to a particular location in the buffer, the location that would be used is the mutable viewport's position, not the virtual viewport's. It's possible that this might work out alright and might not be too confusing, but on paper it certainly sounds like it'll be extra confusing.

@zadjii-msft zadjii-msft added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Question For questions or discussion Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered labels Apr 30, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 30, 2020
@AnuthaDev
Copy link
Contributor Author

My head hurts only reading about all this, this stuff is way above my level. Anyways, thanks @zadjii-msft . Maybe I will try to fix it someday.... maybe😅

@zadjii-msft
Copy link
Member

My head hurts only reading about all this

You have no idea - this was like 3 months of my life 😆

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-Question For questions or discussion Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

2 participants