Repository navigation
Make sure that EraseAll moves the Terminal viewport - #5683
Merged
16 commits merged intoMay 5, 2020
Merged
16 commits merged into
16 commits merged into
Conversation
…e to actually play with it
…ls-shim # Conflicts: # src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp
…uld-work-too # Conflicts: # src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp # src/host/VtIo.cpp # src/host/VtIo.hpp # src/renderer/vt/state.cpp # src/renderer/vt/vtrenderer.hpp
Contributor
|
I’m surprised we didn’t just return false at adaptDispatch. This does seem more robust though. |
Member
Author
derp that would have been easier |
Carlos Zamora (carlos-zamora)
approved these changes
May 4, 2020
Mike Griese (zadjii-msft)
requested a review
from Dustin L. Howett (MSFT) (DHowett-MSFT)
May 4, 2020 21:07
Dustin L. Howett (MSFT) (DHowett-MSFT)
approved these changes
May 5, 2020
Dustin L. Howett (MSFT) (DHowett-MSFT)
left a comment
Contributor
There was a problem hiding this comment.
Okay, I'm comfortable with this.
|
Hello Dustin L. Howett (MSFT) (@DHowett-MSFT)! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
ghost
deleted the
dev/migrie/b/2J-should-work-too
branch
May 5, 2020 01:36
Dustin L. Howett (MSFT) (DHowett-MSFT)
pushed a commit
that referenced
this pull request
May 5, 2020
The Erase All VT sequence (`^[[2J`) is supposed to erase the entire contents of the viewport. The way it usually does this is by shifting the entirety of the viewport contents into scrollback, and starting the new viewport below it. Currently, conpty doesn't propagate that state change correctly. When conpty gets a 2J, it simply erases the content of the connected terminal's viewport, by writing over it with spaces. Conpty didn't really have a good way of communicating "your viewport should move", it only knew "the buffer is now full of spaces". This would lead to bugs like #2832, where pressing <kbd>ctrl+L</kbd> in `bash` would delete the current contents of the viewport, instead of moving the viewport down. This PR makes sure that when conpty sees a 2J, it passes that through directly to the connected terminal application as well. Fortunately, 2J was already implemented in the Windows Terminal, so this actually fixes the behavior of <kbd>ctrl+L</kbd>/`clear` in WSL in the Terminal. ## References * #4252 - right now this isn't the _most_ optimal scenario, we're literally just printing a 2J, then we'll perform "erase line" `height` times. The erase line operations are all redundant at this point - the entire viewport is blank, but conpty doesn't really know that. Fortunately, #4252 was already filed for me to come through and optimize this path. ## PR Checklist * [x] Closes #2832 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * ran tests * compared <kbd>ctrl+L</kbd> with its behavior in conhost * compared `clear` with its behavior in conhost
Dustin L. Howett (MSFT) (DHowett-MSFT)
pushed a commit
that referenced
this pull request
May 5, 2020
The Erase All VT sequence (`^[[2J`) is supposed to erase the entire contents of the viewport. The way it usually does this is by shifting the entirety of the viewport contents into scrollback, and starting the new viewport below it. Currently, conpty doesn't propagate that state change correctly. When conpty gets a 2J, it simply erases the content of the connected terminal's viewport, by writing over it with spaces. Conpty didn't really have a good way of communicating "your viewport should move", it only knew "the buffer is now full of spaces". This would lead to bugs like #2832, where pressing <kbd>ctrl+L</kbd> in `bash` would delete the current contents of the viewport, instead of moving the viewport down. This PR makes sure that when conpty sees a 2J, it passes that through directly to the connected terminal application as well. Fortunately, 2J was already implemented in the Windows Terminal, so this actually fixes the behavior of <kbd>ctrl+L</kbd>/`clear` in WSL in the Terminal. ## References * #4252 - right now this isn't the _most_ optimal scenario, we're literally just printing a 2J, then we'll perform "erase line" `height` times. The erase line operations are all redundant at this point - the entire viewport is blank, but conpty doesn't really know that. Fortunately, #4252 was already filed for me to come through and optimize this path. ## PR Checklist * [x] Closes #2832 * [x] I work here * [x] Tests added/passed * [n/a] Requires documentation to be updated ## Validation Steps Performed * ran tests * compared <kbd>ctrl+L</kbd> with its behavior in conhost * compared `clear` with its behavior in conhost (cherry picked from commit 9fe624f)
|
🎉 Handy links: |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Erase All VT sequence (
^[[2J) is supposed to erase the entirecontents of the viewport. The way it usually does this is by shifting
the entirety of the viewport contents into scrollback, and starting the
new viewport below it.
Currently, conpty doesn't propagate that state change correctly. When
conpty gets a 2J, it simply erases the content of the connected
terminal's viewport, by writing over it with spaces. Conpty didn't
really have a good way of communicating "your viewport should move", it
only knew "the buffer is now full of spaces".
This would lead to bugs like #2832, where pressing ctrl+L in
bashwould delete the current contents of the viewport, instead ofmoving the viewport down.
This PR makes sure that when conpty sees a 2J, it passes that through
directly to the connected terminal application as well. Fortunately, 2J
was already implemented in the Windows Terminal, so this actually fixes
the behavior of ctrl+L/
clearin WSL in the Terminal.References
literally just printing a 2J, then we'll perform "erase line"
heighttimes. The erase line operations are all redundant at this point - the
entire viewport is blank, but conpty doesn't really know that.
Fortunately, Properly support 2J sequence for clearing the screen #4252 was already filed for me to come through and
optimize this path.
PR Checklist
Validation Steps Performed
clearwith its behavior in conhost