pwsh setting console BufferWidth causes terminal to mess up #23970

Closed
opened 2026-01-31 08:57:40 +00:00 by claunia · 2 comments
Owner

Originally created by @FlukeFan on GitHub (Jan 16, 2026).

Windows Terminal version

1.23.13503.0

Windows build number

10.0.22631.0

Other Software

pwsh or powershell.exe

Steps to reproduce

Open pwsh/powershell in WT. Execute the following:

$tempVar = 'M' * 2000
[Console]::BufferWidth = 4096
$tempVar

... then type "My cursor is here", and see that the position of the prompt and the cursor are no longer alligned:

Image

Expected Behavior

I expect the terminal to handle the mutation of the BufferSize without messing up the terminal's output.

Actual Behavior

The terminal loses the position of the cursor.

Originally created by @FlukeFan on GitHub (Jan 16, 2026). ### Windows Terminal version 1.23.13503.0 ### Windows build number 10.0.22631.0 ### Other Software pwsh or powershell.exe ### Steps to reproduce Open pwsh/powershell in WT. Execute the following: ``` $tempVar = 'M' * 2000 [Console]::BufferWidth = 4096 $tempVar ``` ... then type "My cursor is here", and see that the position of the prompt and the cursor are no longer alligned: <img width="1467" height="320" alt="Image" src="https://github.com/user-attachments/assets/865c82f1-e56c-45df-b2b9-2ef544810e9f" /> ### Expected Behavior I expect the terminal to handle the mutation of the BufferSize without messing up the terminal's output. ### Actual Behavior The terminal loses the position of the cursor.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 08:57:40 +00:00
Author
Owner

@DHowett commented on GitHub (Jan 21, 2026):

Thanks for the report! This is a /duplicate of #5094. Resizing through the console APIs is not something we handle very well.

@DHowett commented on GitHub (Jan 21, 2026): Thanks for the report! This is a /duplicate of #5094. Resizing through the console APIs is not something we handle very well.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jan 21, 2026):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Jan 21, 2026): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! <!-- Policy app identification https://img.shields.io/static/v1?label=PullRequestIssueManagement. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23970