Repository navigation
pty: for console compatibility, clear & home cursor if not inherited - #21026
Merged
Merged
Conversation
Old versions of ConPTY used to clear the screen and move the cursor to the top left. Unfortunately, that's still required, but we lost it in the rewrite. Applications that host console apps may not be prepared to answer a CPR and if they aren't, we need to behave like a good citizen. We could also make cursor inheritance the default, but since positioning the cursor is blocking we would be adding a 1s delay for _all_ consumers who cannot answer DSR CPR.
Dustin L. Howett (DHowett)
force-pushed
the
dev/duhowett/conpty-compat-bug
branch
from
December 4, 2026 21:14
12d3eef to
cee9141
Compare
This comment has been minimized.
This comment has been minimized.
Comment on lines
+199
to
+200
| writer.WriteED(DispatchTypes::EraseType::All); | ||
| writer.WriteCUP(til::point{}); |
Member
Author
There was a problem hiding this comment.
If we are never gonna use the flexibility here, we could also just...
writer.WriteUTF8("\x1b[2J\x1b[H");
Leonard Hecker (lhecker)
approved these changes
Dec 5, 2026
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.
Old versions of ConPTY used to clear the screen and move the cursor to the top left. Unfortunately, that's still required, but we lost it in the rewrite.
Applications that host console apps may not be prepared to answer a CPR and if they aren't, we need to behave like a good citizen.
We could also make cursor inheritance the default, but since positioning the cursor is blocking we would be adding a 1s delay for all consumers who cannot answer DSR CPR.
Leonard and I hashed this out for quite a while, so in the interest of documenting:
CPRCloses MSFT-62634678