-
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
Original console buffer is not restored when closing a secondary one #17817
Comments
While it's not mine to decide, and personally I can wait for a build with this fixed, I'd think it would be nice to fix it in 1.22, because it's still relatively early and only one preview build was released of 1.22, and it does affect the default behavior of existing applications, such as |
The milestone for us just indicates in what period we're working on it. Now that 1.22 was released we're in the 1.23 development period and so on. We usually spend the beginning of each period for fixing bugs in the just released versions. That will also be the case for this issue. In short, I'm going to fix this soon. 🙂 |
Was it? Yesterday 1.21 had the first stable release: "Terminal 1.21 is finally stable!...". and 1.22 had the first preview build. Doesn't that mean that 1.21 is now ready for most users, but that there's still work to bugfix before 1.22 becomes stable and ready for public consumption? I.e. that "stable" is for most users, and that "preview" is for early adopters which can test it and report issues which would hopefully get fixed before 1.22 is considered "Ready" and distributed to the larger public? The store page says about "Windows Terminal Preview":
I.e. that there's still work to be done before the preview version is considered "ready"?
That's nice, though my main concern was/is that there would be a "stable" version which is distributed to a large number of people which has this issue... Or am I missing something with the "stable"/"preview" terminology and/or pipeline? |
This could be rephrased to something like "contains the latest features that we think are ready, but may not be entirely stable yet" (though there's a philosophical question about whether any software is ever truly "stable", as pretty much all software contains bugs 😄). Basically, both "Windows Terminal" (current version |
Yeah, that's what I thought too. So do you consider "restore screen buffer correctly like it behaved in 1.21" a new feature? To me that's more like a bugfix in 1.22. Is it not? (that's not to say that it must be fixed in 1.22. I marely expressed hope that it could get fixed in 1.22 before it becomes stable). |
Well, I would certainly consider it a bugfix (though I'm not part of the team), but I think the point is that the milestone just indicates that the fix will be developed on the branch for 1.23. It would then presumably be cherry-picked or backported to 1.22 assuming the fix isn't riskier than the impact of the bug. |
Right. That was my missing link. That makes sense to me. Thanks. |
That's all correct.
|
I'm on 1.21 and I can't get the buffer to restore. Open windows from a previous session is set. Am I doing something wrong? |
This issue is not about restoring the content from a previous session when opening a new terminal window. It's about restoring the screen content after an application (like an editor, or pager) creates and works in a new screen buffer, and then exits. |
@richardeid If you still have this issue, please open a discussion or open another issue. We'll then try to help you. |
@lhecker I think I misunderstood what this was. I was expecting my console history to restore. Thank you for following up |
I can confirm that the build artifact of #17853 has this issue fixed. Tested with the C test progam given above, and also other use cases with |
Thanks. Confirmed build artifact of 544452d is fixed. |
Can confirm this is fixed in the latest Preview v1.22.2702.0 . |
Windows Terminal version
1.22.240823002-preview
Windows build number
10.0.19045
Other Software
No response
Steps to reproduce
Reduced test code (by lhecker):
Run a program which creates and activates a new console screen buffer using
CreateConsoleScreenBuffer
andSetConsoleActiveScreenBuffer
.The following C program with argument value 0-4 does all combos:
newbuf.c
Expected Behavior
Original screen buffer is restored when the application exits (its content and original cursor position), regardless if the new screen buffer handle is closed or not, and regardless if the original screen buffer is re-activated before exit.
Actual Behavior
No issue in conhost.exe or OpenConsole.exe (even of 1.22), or Windows terminal up to and including 1.21.
With Windows terminal 1.22 (preview):
SetConsoleActiveScreenBuffer(orig_con)
is invoked without or beforeCloseHandle(h_newbuf)
.CloseHandle
norSetConsoleActiveScreenBuffer(orig_con)
are used.CloseHandle
is used.CloseHandle
andSetConsoleActiveScreenBuffer(orig_con)
are used in that order.The text was updated successfully, but these errors were encountered: