-
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
BUG: Minimizing Terminal Crash #1795
Comments
I'm not sure if it's the same crash, but while trying to repro this, I managed to get an exception while restoring down from maximize while the app was outputting.
Looked like it was trying to draw one of the lines that's now outside the viewport. Perhaps we're not locking the terminal properly for certain resize types? Or we've moved the viewport to a bad position on restore down? Fortunately, the repro is easy enough, so we just need to dig in more. Thanks! |
Leaving notes here for me after the weekend: Trying to repro this, the terminal moves between [118x26]<->[207x61] When we crash, the conpty's buffer has 61 rows with 118 chars each. We're trying to render row 60, and we want all 207 characters from it. Seems to imply that the buffer's width wasn't resized, but the height was. That's not right. |
Okay debugging more into this. For my repro, the resize is from [207x61] -> [118x26] When we resize in ConPty, we call both
Later on, we'll try and render a new frame, and try to render the 60th line of the buffer, with a width of 207 chars. The buffer does incorrectly still have 61 lines, but it only has 118 chars per row, so the renderer throws an exception that's not caught here, crashing conpty. Conpty crashing causes the terminal to crash. Now we just need to come up with the right solution for handling this resize. Very simply, we could maybe tell conpty to not paint at all during a resize. Might be too risky a change for 0.3, however. |
@zadjii-msft Maybe, kind of, #1946? It got lost somewhere in the swarm of issues few weeks ago :( |
@mcpiroman It's probably related to the larger class of "conpty resizing issues". I think it might be able to improve the QOL for the terminal by fixing this particular bug now, while a more complete design of the right way to handle conpty resizing is a while off. I do still owe you a response on that other issue though. |
When we resize the conpty buffer, we'll call into SCREEN_INFORMATION::_InternalSetViewportSize, which will try to keep the commandline visible. However, we don't even want the commandline visible while that's happening. We should hide it and reflow the start of the commandline. I'm actually not sure this is the fix for #1095. #1095 uses WSL, which isn't going to be COOKED_READing. Aditionally, the commandline can end up in some weird places after this. Like when restoring down with a commandline wider than the restored width, the commandline will appear one line below where it should. That might be a side effect of the rest of the changes I'm prototyping (for #1795)
…operation This fixes #1795, and shined quite a bit of light on the whole conpty resize process.
* Don't trigger a frame due to circling when in the middle of a resize operation This fixes #1795, and shined quite a bit of light on the whole conpty resize process. * Move the Begin/End to ResizeScreenBuffer, to catch more cases.
🎉This issue was addressed in #2149, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Execute a command that keeps outputting something for a while.
for example you can user
apt list
orls
in a directory with a lot of content.Then, while the command is running, double click on the titlebar or click the minimize? button.
Expected behavior
The behavior I would have expected was for it to pause or keep running
Actual behavior
The Terminal Freezes and crashes after approximately 1,5 seconds
Other Terminal windows are unaffected
The text was updated successfully, but these errors were encountered: