ConPTY: Ask for the cursor position after each resize #23068

Open
opened 2026-01-31 08:31:22 +00:00 by claunia · 0 comments
Owner

Originally created by @lhecker on GitHub (Mar 26, 2025).

Originally assigned to: @lhecker on GitHub.

Description of the new feature

ConPTY's reflow algorithm may differ from the hosting terminal and that may result in ConPTY returning wildly incorrect cursor positions via GetConsoleCursorInfo. This results in the cursor being inside the previous prompt when resizing PowerShell in VS Code.

Proposed technical implementation details

Use the existing DSC CPR facilities in VtIo but make them more flexible so that they can be called more than once.

Complications:

  • The request must block the console server
  • ...but it must not block further incoming resizes (= debounce)
Originally created by @lhecker on GitHub (Mar 26, 2025). Originally assigned to: @lhecker on GitHub. ### Description of the new feature ConPTY's reflow algorithm may differ from the hosting terminal and that may result in ConPTY returning wildly incorrect cursor positions via `GetConsoleCursorInfo`. This results in the cursor being inside the previous prompt when resizing PowerShell in VS Code. ### Proposed technical implementation details Use the existing DSC CPR facilities in `VtIo` but make them more flexible so that they can be called more than once. Complications: * The request must block the console server * ...but it must not block further incoming resizes (= debounce)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23068