-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Preview 1.22.2362.0
breaks Terminal.Gui apps
#17949
Comments
May I suggest the WT add some Terminal.Gui tests to the WT test suite? It's a pretty popular library for building TUI apps that stresses a ton of terminal capabilites. I'd be happy to collaborate on that! |
I think you could actually argue that the new implementation is more correct than the old one, because as it turns out you're accidentally asking for a window that's 1 row less tall every time you switch between screen buffers. Since we currently forbid changing the screen size, this means that the content that gets copied is 1 row less tall without the window size having changed. This happens because you call This is the stack trace:
The issue is in // ...
if (!GetConsoleScreenBufferInfoEx (_screenBuffer, ref csbi))
{
throw new Win32Exception (Marshal.GetLastWin32Error ());
}
csbi.srWindow.Bottom += 1; // <---
csbi.srWindow.Right += 1; // <---
Size sz = new (
csbi.srWindow.Right - csbi.srWindow.Left, // <---
Math.Max (csbi.srWindow.Bottom - csbi.srWindow.Top, 0)); // <---
position = new (csbi.srWindow.Left, csbi.srWindow.Top);
SetConsoleOutputWindow (csbi);
// ... |
I agree that the old behavior was odd/incorrect and the new behavior is more correct. We can work on a fix to both Terminal.Gui v1 and v2. Tracking here gui-cs/Terminal.Gui#3752 However, I would like to understand the WT team's tenets around not breaking existing apps. Back in the olden days for Windows we were quite hardcore about this. Even if we had a bug in Windows we went to extraordinary lengths to not break existing apps. Have you exhausted all options for how you can implement the new behavior in a way that won't break existing apps that use the API as it worked before? |
There seems to have been a misunderstanding... I haven't even thought about closing this bug yet. 😅 I was just working on other issues first after my initial investigation above. This was surely due to me being too terse in my response. I apologize for that. That said, I believe we can solve this by using the window size assigned via the signal pipe for all |
No problem! I get it. Thanks for taking the time.
|
Hmm this is unfortunately actually not all that easy in our current architecture. I may have to do that later. |
@tig I think I fixed this in the gui-cs/Terminal.Gui#3768. |
Maybe you did, but that doesn't fix existing Terminal.Gui v1 and v2 apps (like OCGV). |
Windows Terminal version
1.22.2362.0
Windows build number
10.0.26120.0
Other Software
Terminal.Gui - any version
Steps to reproduce
UICatalog
from the Terminal.Gui solution.Each of these is like running a Termina.Gui app afresh.
The same thing can be reproduced by just running
.\UICatalog\bin\Debug\net8.0\UICatalog.exe
and exiting repeatedly.Expected Behavior
Actual Behavior
Note the bottom of the terminal is corrupt with prior content and the new instance of the app is not getting the correct terminal dimensions (too small).
The text was updated successfully, but these errors were encountered: