-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Scrolling within regions that include the top of the screen doesn't push lines into scrollback #3673
Comments
I think this is related to the scrolling margins. You'll see a similar problem when setting the scrolling margins to the first 10 lines of the screen with a bash command like this:
Then try doing a directory listing or output a lot of content that will cause the view to scroll. The scrolling will be limited to the top 10 lines, as expected, but anything that scrolls off the top of the screen is lost. I think this is just a limitation of the current conpty implementation. It doesn't know anything about scrolling regions, so unless you're scrolling the full screen height, it won't update the scrollback buffer correctly. |
We'll need to capture some VT from minicom to figure out exactly what it's doing here. Would you be willing to run it under |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I'm experiencing the same issues. |
Sure! Check this out. If you run Here's the steps, roughly.
The file looks something like this: All of those blue characters are the raw escape sequences that came out of my shell, and for you will be the ones coming out of minicom. |
Attached is a script file |
Thanks a lot! Just to make sure: I am seeing the bottom bar, which is red, duplicated multiple times on the screen. Is that the only issue? If there's more issues than that, would you mind sharing a screenshot? |
(If it's the bug where the scrollback is deleted, that's just how it's designed right now, unfortunately.) |
Yes, the red bottom bar is fine - no problem here. It's part of minicom when enabling color mode. |
Ah! Thanks again for the test case. James's initial suspicion is right: there's a scrolling region, and we don't handle that great right now. |
I'm re-opening this to track the scrolling margins + conpty issue, and tossing it on the backlog. Thanks! |
I'll rename it to be something more scannable. |
Hi, is there any plan to fix this issue soon? |
@ThomasHornschuh Not particularly - it's being tracked as a part of our "Next Windows Release" milestone, but that doesn't really have any sort of timeline (certainly not one I can share publicly). Sorry about that! |
Just writing to say I found this post googling the same issue.
It's only in Windows Terminal where it's all screwy and annoying. :( Thanks for the hard work though guys! I'm a big fan of terminal! |
Any news for this issue? |
Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button? This is also vaguely similar to #6056. I'm xlinking just in case, but I might be totally off base on that. Telnet doesn't actually use the margins, and I believe our theory with that one is that telnet.exe is actually running its own VT parser and using the Console API to scroll the buffer. But, that might be a similar enough scenario that doesn't work in ConPTY that we may want to come up with a universal solution to both. |
FYI, I think I may have inadvertently fixed this issue while I was working on merging the |
That's quite exciting! 😄 |
The main purpose of this PR was to merge the `ITerminalApi::LineFeed` implementations into a shared method in `AdaptDispatch`, and avoid the VT code path depending on the `AdjustCursorPosition` function (which could then be massively simplified). This refactoring also fixes some bugs that existed in the original `LineFeed` implementations. ## References and Relevant Issues This helps to close the gap between the Conhost and Terminal (#13408). This improves some of the scrollbar mark bugs mentioned in #11000. ## Detailed Description of the Pull Request / Additional comments I had initially hoped the line feed functionality could be implemented entirely within `AdaptDispatch`, but there is still some Conhost and Terminal-specific behavior that needs to be triggered when we reach the bottom of the buffer, and the row coordinates are cycled. In Conhost we need to trigger an accessibility scroll event, and in Windows Terminal we need to update selection and marker offsets, reset pattern intervals, and preserve the user's scroll offset. This is now handled by a new `NotifyBufferRotation` method in `ITerminalApi`. But this made me realise that the `_EraseAll` method should have been doing the same thing when it reached the bottom of the buffer. So I've added a call to the new `NotifyBufferRotation` API from there as well. And in the case of Windows Terminal, the scroll offset preservation was something that was also needed for a regular viewport pan. So I've put that in a separate `_PreserveUserScrollOffset` method which is called from the `SetViewportPosition` handler as well. ## Validation Steps Performed Because of the API changes, there were a number of unit tests that needed to be updated: - Some of the `ScreenBufferTests` were accessing margin state in the `SCREEN_INFORMATION` class which doesn't exist anymore, so I had to add a little helper function which now manually detects the active margins. - Some of the `AdapterTest` tests were dependent on APIs that no longer exist, so they needed to be rewritten so they now check the resulting state rather than expecting a mock API call. - The `ScrollWithMargins` test in `ConptyRoundtripTests` was testing functionality that didn't previously work correctly (issue #3673). Now that it's been fixed, that test needed to be updated accordingly. Other than getting the unit tests working, I've manually verified that issue #3673 is now fixed. And I've also checked that the scroll markers, selections, and user scroll offset are all being updated correctly, both with a regular viewport pan, as well as when overrunning the buffer. Closes #3673
Environment
Windows Terminal version: Version: 0.6.2951.0
Microsoft Windows [Version 10.0.18362.418]
Steps to reproduce
Expected behavior
If I scroll up, I should be able to see the serial console messages from my embedded target.
Actual behavior
Scroll up shows my command that I typed long ago. The serial console message is lost. If I run Ubuntu terminal directly (instead of doing the same from Windows Terminal), I could scroll up and see right messages.
Not sure, may be ncurses behavior is not compatible with Windows Terminal's expectations?
The text was updated successfully, but these errors were encountered: