-
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
ED2 inserts loads of blank lines in scrollback #16603
Comments
It seems that this issue occurs as soon as a line wrap occurs (in my case when the window is <98 columns wide). |
FYI, it looks like this broke in commit 7474839 (PR #15701), although I'm not sure why. Edit: After that commit, the |
I found that the culprit is the change to I'm not sure if I'm seeing this correctly but I believe that's a preexisting bug in I'm working on a change now that replaces the |
I think that issue may have been introduced by PR #15541. The original
That sounds like a good idea, but I think that still leaves a bug in the |
Should I'm not entirely sure I understand why |
Ah, I think I can see now why it does it that way. Gnome Terminal scrolls just enough to move the current content into the scrollback (i.e. 3 lines of 3 lines are visible). What I find somewhat curious is that a second I believe the proper way to fix For now I'll submit just the |
I think it might be a bug, yeah. It's mentioned in VTE's issue 1471. Personally I think I'd prefer if
You may be right, but all I can remember of |
Forgot to respond to this, but I'm not really sure what the correct behavior should be. My first thought was that any operation that writes to the buffer should reset the flag on the lines it touches, because in a pure wrapping scenario that should never happen. Once you've wrapped a line, you shouldn't really be going back to change it. And if you did go back, like a shell prompt where you've backspaced onto the previous line, then I think that probably should "unwrap" it. I suspect it's more complicated than that, though, and maybe we need to look at what other terminals are doing. But for now I'd be inclined to just put it back to what it was (i.e. resetting the flag when |
It just occurred to me that there's another complication with |
I've been thinking some more about This is only tangentially related, but in the future I'd prefer if we were to store |
I still must object in the strongest possible but still civil terms to this. It's been a year, and I am still not convinced that we should store text in wire format. 🙂 |
What I brought up doesn't work anyways unless I build it and I haven't, so in a way it's just an... anecdote? Or maybe, rather an example. When I said "it would allow us" I meant it quite literally (i.e. as a hypothetical) and that's important to me, because... My point was basically that building on top of an existing architecture to introduce new behavior may prevent us from efficiently switching the underlying architecture if we ever chose to. Not just regarding the text buffer but any other part of any project. Both conhost and WT are fairly tightly entangled between different components. Making it so that To give more examples, the rendering interface is also problematic (as I mentioned before), as the |
#15541 changed `AdaptDispatch::_FillRect` which caused it to not affect the `ROW::_wrapForced` flag anymore. This change in behavior was not noticeable as `TextBuffer::GetLastNonSpaceCharacter` had a bug where rows of only whitespace text would always be treated as empty. This would then affect `AdaptDispatch::_EraseAll` to accidentally correctly guess the last row with text despite the `_FillRect` change. #15701 then fixed `GetLastNonSpaceCharacter` indirectly by fixing `ROW::MeasureRight` which now made the previous change apparent. `_EraseAll` would now guess the last row of text incorrectly, because it would find the rows that `_FillRect` cleared but still had `_wrapForced` set to `true`. This PR fixes the issue by replacing the `_FillRect` usage to clear rows with direct calls to `ROW::Reset()`. In the future this could be extended by also `MEM_DECOMMIT`ing the now unused underlying memory. Closes #16603 ## Validation Steps Performed * Enter WSL and resize the window to <40 columns * Execute ```sh cd /bin ls -la printf "\e[3J" ls -la printf "\e[3J" printf "\e[2J" ``` * Only one viewport-height-many lines of whitespace exist between the current prompt line and the previous scrollback contents ✅
#15541 changed `AdaptDispatch::_FillRect` which caused it to not affect the `ROW::_wrapForced` flag anymore. This change in behavior was not noticeable as `TextBuffer::GetLastNonSpaceCharacter` had a bug where rows of only whitespace text would always be treated as empty. This would then affect `AdaptDispatch::_EraseAll` to accidentally correctly guess the last row with text despite the `_FillRect` change. #15701 then fixed `GetLastNonSpaceCharacter` indirectly by fixing `ROW::MeasureRight` which now made the previous change apparent. `_EraseAll` would now guess the last row of text incorrectly, because it would find the rows that `_FillRect` cleared but still had `_wrapForced` set to `true`. This PR fixes the issue by replacing the `_FillRect` usage to clear rows with direct calls to `ROW::Reset()`. In the future this could be extended by also `MEM_DECOMMIT`ing the now unused underlying memory. Closes #16603 ## Validation Steps Performed * Enter WSL and resize the window to <40 columns * Execute ```sh cd /bin ls -la printf "\e[3J" ls -la printf "\e[3J" printf "\e[2J" ``` * Only one viewport-height-many lines of whitespace exist between the current prompt line and the previous scrollback contents ✅ (cherry picked from commit 5f71cf3) Service-Card-Id: 91707937 Service-Version: 1.19
Windows Terminal version
1.19.3172.0
Windows build number
10.0.19045.3930
Other Software
No response
Steps to reproduce
Open a WSL bash shell in Windows Terminal.
Execute the following set of commands:
Scroll up to view the scrollback buffer.
Expected Behavior
You should see the last lines of the
/bin
directory listing and the twoprintf
commands.Actual Behavior
The buffer immediately above the visible viewport is blank, and you have to scroll back for pages to find the previous content.
Reproducing this might be a bit tricky, because if I replace the
ls -la
with something likeseq 1000
, the bug isn't triggered. There must be something about the directory listing that's a factor, and hopefully it's not specific to my directory content. And in case it makes any difference, my screen size is 80x24.It's also worth noting that I can reproduce this in a recent version of OpenConsole, but not in my inbox ConHost (Windows 10), so it looks like it might be a regression.
The text was updated successfully, but these errors were encountered: