-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[megathread] ConPTY buffer gets out-of-sync #15976
Comments
As one can see, the problem is To me, it seems like this is the root cause of #6546. In the above demo, notice how the cursor is at exactly the same place on both WT and openconsole, even after the out of sync buffers (this is just because rows haven't changed their location, even though the characters within the rows did). This might be why the issue is not so obvious right when it gets out of sync. Instead, it becomes visible only after certain amount of resize and reflow, where WT buffer rows move (up/down) at different rate then the pty buffer rows. |
Caught in action! caught-in-action.mp4 |
Just realized @zadjii-msft already have explained this in his now-closed PR #4354 (comment). |
FYI I recently added This is a well known issue and will likely remain unresolved for now. I think we can keep this one open, but I also feel like we might want to make it into a "meta" issue that is about the architectural problem in general (= maintaining 2 buffers out of proc results in desync) and then just lists all the fallout issues it creates (like the line wrapping issue you described). Personally speaking, I don't know how to solve it. I'm not even sure it's possible to solve it at all while maintaining ConPTY as is. Because on top of the line wrapping issue you mentioned, there's also a race condition between ConPTY reflowing its buffer and a ConPTY client like WT reflowing its buffer. Since those two can happen out of order, text or commands may be ingested by ConPTY while one buffer has been resized and the other hasn't. This however doesn't solve the issue you mentioned which requires that the ConPTY client / WT resizes its window first, so that we can send ConPTY the expected viewport contents (which only we can know since we have the scrollback), which inadvertently results in the issue I mentioned. |
maintainer edit: we're promoting this to a megathread cause this is a Hard problem. This is now tracking "try to make an in-proc version of conpty"
See: #15976 (comment) for details.
Thoughts:
Things we might be able to actually solve with this:
Windows Terminal version
1.17.11461.0
Windows build number
22621.2283
Other Software
No response
Steps to reproduce
This is an indirect repro, since we can't see how the openconsole buffer looks like at any instant when it's acting as a conpty.
wt.exe
andopenconsole.exe
.pwsh
, you can simply pressenter
, and it will echo the string back. That should be enough in this case.Expected Behavior
After the reflow, both buffers should stay in sync.
Actual Behavior
Buffers are out of sync.
The text was updated successfully, but these errors were encountered: