You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"CLS" does not clear the screen after "MODE" #5079
I mean, the real problem here is that mode doesn't change the size of the Terminal. #4062 is fairly similar, but different enough. I'd bet that mode is changing the size of the conpty buffer, but that size change is never communicated to the Terminal, and that's what's making it seem like the screen hasn't cleared. The conpty's screen probably has cleared, but that's only caused the 10x10 region in the top of the Terminal buffer to get cleared.
Note that this is a problem for all the VT resizing sequences too. For example, you'll get the same problem resizing the screen from within a bash shell like this:
printf "\e[8;10;10t"
And if you want to make mode work, then you'll probably want to start with the VT sequences first, because ultimately that's how you're going to have to communicate this information to the Terminal.
The real issue, though, is deciding how the Terminal should deal with a resize request. When you've got multiple tabs, each potentially requesting a different size, you can't satisfy all of them at once. I've been thinking about this for a while, and there were three approaches that I considered:
Ignore the size request, as we are doing now. But for this to work, it's vital that the Terminal communicate back to the host that the request has failed. If you don't do that, the Terminal and conhost get out of sync, and the renderer goes barmy..
Accept the requested size as a kind of virtual window, similar to the way conhost works when the buffer width and window width are different. If the virtual window is larger than the actual window, you'll need to be able to scroll across the viewport, both horizontally and vertically (the latter being kind of tricky to differentiate from the scrollback).
Accept the requested size and actually resize the whole Terminal window to fit, but only if the tab making the request is currently focused. A background tab shouldn't be able to change the size. And as with option 1, it's vital that the resulting sizes are communicated back to the different hosts for each tab.
Personally I'm in favor of option 3, but I suspect others will disagree, and it may need to be a configurable preference. It's also possible there are other better approaches that I haven't thought of.
Moved discussion about resize to #5094. The pseudoconsole actually does send out window manipulation (because it needed to when you run cmd.exe inside WSL), so that part is covered.
As for the bug here: right now, unfortunately, it's by design because we do not support resizing the terminal with MODE. It's operating as expected when you clear the new smaller window.
Activity
[-]"CLS" does not clear the screen after "MODE"[/-][+]"CLS" still does not clear the screen after "MODE"[/+][-]"CLS" still does not clear the screen after "MODE"[/-][+]"CLS" does not clear the screen after "MODE"[/+]zadjii-msft commentedon Mar 23, 2020
I mean, the real problem here is that
modedoesn't change the size of the Terminal. #4062 is fairly similar, but different enough. I'd bet thatmodeis changing the size of the conpty buffer, but that size change is never communicated to the Terminal, and that's what's making it seem like the screen hasn't cleared. The conpty's screen probably has cleared, but that's only caused the 10x10 region in the top of the Terminal buffer to get cleared.j4james commentedon Mar 23, 2020
Note that this is a problem for all the VT resizing sequences too. For example, you'll get the same problem resizing the screen from within a bash shell like this:
And if you want to make
modework, then you'll probably want to start with the VT sequences first, because ultimately that's how you're going to have to communicate this information to the Terminal.The real issue, though, is deciding how the Terminal should deal with a resize request. When you've got multiple tabs, each potentially requesting a different size, you can't satisfy all of them at once. I've been thinking about this for a while, and there were three approaches that I considered:
Ignore the size request, as we are doing now. But for this to work, it's vital that the Terminal communicate back to the host that the request has failed. If you don't do that, the Terminal and conhost get out of sync, and the renderer goes barmy..
Accept the requested size as a kind of virtual window, similar to the way conhost works when the buffer width and window width are different. If the virtual window is larger than the actual window, you'll need to be able to scroll across the viewport, both horizontally and vertically (the latter being kind of tricky to differentiate from the scrollback).
Accept the requested size and actually resize the whole Terminal window to fit, but only if the tab making the request is currently focused. A background tab shouldn't be able to change the size. And as with option 1, it's vital that the resulting sizes are communicated back to the different hosts for each tab.
Personally I'm in favor of option 3, but I suspect others will disagree, and it may need to be a configurable preference. It's also possible there are other better approaches that I haven't thought of.
DHowett-MSFT commentedon Mar 24, 2020
Ugh, we don't have an issue for handling resize in Terminal? Sorry.
DHowett-MSFT commentedon Mar 24, 2020
Moved discussion about resize to #5094. The pseudoconsole actually does send out window manipulation (because it needed to when you run
cmd.exeinside WSL), so that part is covered.As for the bug here: right now, unfortunately, it's by design because we do not support resizing the terminal with
MODE. It's operating as expected when you clear the new smaller window./dup #5094