[ConPTY] Resizing ConPTY is sometimes ignored if executed near (before/after) a call to attach a client #14198

Open
opened 2026-01-31 04:03:33 +00:00 by claunia · 0 comments
Owner

Originally created by @o-sdn-o on GitHub (Jun 10, 2021).

Windows Terminal version (or Windows build number)

build from source (conhost.exe replaced by OpenConsole.exe)

Other Software

Terminal multiplexer: vtm 0.4.0 (https://github.com/netxs-group/VTM)

Steps to reproduce

Resize ConPTY several times immediately after creation.

In vtm, ConPTY is used as an element within a structure of interconnected elements. This is something like WPF.

The resulting size of the control depends on dynamically added sub-elements, so the final size of the ConPTY is not known at the time of its creation. The size is calculated step by step during the construction of the final object. This is usually two or three very quick iterations after the ConPTY is created.

Here is an example:

Creating a window with powershell. The intermediate size of the ConPTY during creation is 104x11 (~half the window), but by the time the object is created, the ConPTY should be 104x21.

https://user-images.githubusercontent.com/11535558/121590076-501a6180-ca51-11eb-9fea-cb541a51a626.mp4

The following sequence is executed

  • CreatePseudoConsole(104x11 ...
  • CreateProcess( ..powershell...
  • ...
  • ResizePseudoConsole(hPC, 104x11);
  • ...
  • ResizePseudoConsole(hPC, 104x21);

Expected Behavior

ConPTY must be the last requested size.

Actual Behavior

ConPTY is not the last requested size.

Originally created by @o-sdn-o on GitHub (Jun 10, 2021). ### Windows Terminal version (or Windows build number) build from source (conhost.exe replaced by OpenConsole.exe) ### Other Software Terminal multiplexer: vtm 0.4.0 (https://github.com/netxs-group/VTM) ### Steps to reproduce Resize ConPTY ~~several times~~ immediately after creation. In vtm, ConPTY is used as an element within a structure of interconnected elements. This is something like WPF. The resulting size of the control depends on dynamically added sub-elements, so the final size of the ConPTY is not known at the time of its creation. The size is calculated step by step during the construction of the final object. This is usually two or three very quick iterations after the ConPTY is created. Here is an example: Creating a window with `powershell`. The intermediate size of the ConPTY during creation is `104x11` (~half the window), but by the time the object is created, the ConPTY should be `104x21`. https://user-images.githubusercontent.com/11535558/121590076-501a6180-ca51-11eb-9fea-cb541a51a626.mp4 The following sequence is executed - `CreatePseudoConsole(104x11 ...` - `CreateProcess( ..powershell...` - ... - `ResizePseudoConsole(hPC, 104x11);` - ... - `ResizePseudoConsole(hPC, 104x21);` ### Expected Behavior ConPTY must be the last requested size. ### Actual Behavior ConPTY is not the last requested size.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14198