-
Notifications
You must be signed in to change notification settings - Fork 83
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
Set $Host.UI.RawUI.MaxPhysicalWindowSize #302
Comments
Not sure if this is what you're looking for, but here is some documentation on |
Thanks @tgauth, however, this only speaks about getting the value, not setting it. It also refers to the actual display, which is not relevant here in the context of a pseudo console. In my example, WindowSize is larger than MaxPhysicalWindowSize and everything works fine until the tool restores the terminal and uses the MaxPhysicalWindowSize as upper bound. Googling about it yielded quite a few examples of tools/scripts doing the same, checking MaxPhysicalWindowSize before setting the actual size, maybe it is an issue with those tools? How does windows sets this value? In the context of a pseudo console, the actual size of the physical or virtual display attached is irrelevant and needs to be set, or am I missing something? |
In the native Win32 console API this field is called It seems like we should return 65535,65535 for
Edit: Actually, maybe I'm misunderstanding @zadjii-msft Should we move this issue over to the terminal repo? Seems more like a bug to me. (Also, heavily related to our vim sizing issues?) |
Oh, so this is almost definitely the root cause of microsoft/terminal#16254 then isn't it 😮 We should definitely track this on the terminal repo somewhere - terminal#16254 is probably a good enough place. I'd want us to double-check the history here. IIRC we were returning 1,1 years ago1, so I'd want to see if we've got the history on why we picked the current buffer size (or if that was just a totally arbitrary decision) Footnotes
|
I dearly hope vim isn’t using the max physical window size to position the cursor. That value has no bearing on the actual buffer the user was looking at. How could it be the root cause?
The problem is that this question has no answer. There is no guarantee of a physical window, and when there is a physical window we cannot know its limits. Is it more correct to say 64k than 1? I disagree 😄 |
Hello,
I can't find any reference to
MaxPhysicalWindowSize
in the console docs, I may be missing something, but is there a way to set this value?The initial
COORD
inCreatePseudoConsole
and inResizePseudoConsole
seem to only take X/Y.Some programs like vim and other use it as upper bound. Upon exit, it restores the terminal modes and size, which results in the wrong one, breaking the terminal.
While I am working on adding support for conpty in a Go library, I noticed that OpenSSH has the same issue.
Open/Close vim result:
Any pointer would be appreciated.
For reference:
windows 2022 server without desktop: 10.0.20348.0
sshd: OpenSSH_for_Windows_8.0p1
vim: 9.0 (2022 Jun 28)
The text was updated successfully, but these errors were encountered: