How to use ConPTY API to resize the console correctly? #1535

Open
opened 2026-01-30 22:29:45 +00:00 by claunia · 0 comments
Owner

Originally created by @martincohen on GitHub (Jun 6, 2019).

I'm missing documentation/guidance on how to deal with resizing the window from embedded terminal I'm adding to my application. There's ResizePseudoConsole function, that also seems to cause reflow of the buffer (assuming this is taken care of by conhost).

In the terminal codein this repo, I saw you are also sending \x1b[7t after calling ResizePseudoConsole through the pipe to the child process. Is this a requirement?

Is there a way to know that the child process has acknowledged the new size? Currently there's a bit of time in which the app keeps sending commands with old size before it picks up the information from the input (but it might be an issue of how I buffer stuff). However a general guidance of how the resize process should work would be very helpful.

Originally created by @martincohen on GitHub (Jun 6, 2019). <!-- What needs to change? Who is responsible for it? Why is it an open question? --> I'm missing documentation/guidance on how to deal with resizing the window from embedded terminal I'm adding to my application. There's `ResizePseudoConsole` function, that also seems to cause reflow of the buffer (assuming this is taken care of by conhost). In the terminal codein this repo, I saw you are also sending `\x1b[7t` after calling `ResizePseudoConsole` through the pipe to the child process. Is this a requirement? Is there a way to know that the child process has acknowledged the new size? Currently there's a bit of time in which the app keeps sending commands with old size before it picks up the information from the input (but it might be an issue of how I buffer stuff). However a general guidance of how the resize process should work would be very helpful.
claunia added the Issue-QuestionArea-VTResolution-AnsweredProduct-Conpty labels 2026-01-30 22:29:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1535