Cursor position is lost when resizing the window horizontally #14779

Closed
opened 2026-01-31 04:19:13 +00:00 by claunia · 6 comments
Owner

Originally created by @daanx on GitHub (Aug 4, 2021).

Windows Terminal version (or Windows build number)

10.0.19042.1110 (windows terminal 1.9.1942.0)

Other Software

No response

Steps to reproduce

When the windows is horizontally resized the cursor position is lost; on the narrowing the cursor wraps to the next line, but on widening again the cursor goes incorrectly to the start of the previous line.
(Extra heisenbug: if you quickly resize narrow again the cursor will go randomly in the text :-)

To reproduce run the following batch file:

@echo off
set /p "ANSWER=prompt prompt prompt prompt prompt prompt prompt>"

Expected Behavior

On the old cmd terminal the batch file works as intended.

Actual Behavior

Here is what happens in Windows terminal (I colored the cursor in red):

cursor-bug

Originally created by @daanx on GitHub (Aug 4, 2021). ### Windows Terminal version (or Windows build number) 10.0.19042.1110 (windows terminal 1.9.1942.0) ### Other Software _No response_ ### Steps to reproduce When the windows is horizontally resized the cursor position is lost; on the narrowing the cursor wraps to the next line, but on widening again the cursor goes incorrectly to the _start_ of the previous line. (Extra heisenbug: if you quickly resize narrow again the cursor will go randomly in the text :-) To reproduce run the following batch file: ```bat @echo off set /p "ANSWER=prompt prompt prompt prompt prompt prompt prompt>" ``` ### Expected Behavior On the old cmd terminal the batch file works as intended. ### Actual Behavior Here is what happens in Windows terminal (I colored the cursor in red): ![cursor-bug](https://user-images.githubusercontent.com/2171100/128130465-6b28c428-d9ee-4172-87c2-be9ba8f183ce.png)
Author
Owner

@daanx commented on GitHub (Aug 4, 2021):

perhaps this is related to the earlier bug I filed #10848 ?

@daanx commented on GitHub (Aug 4, 2021): perhaps this is related to the earlier bug I filed #10848 ?
Author
Owner

@zadjii-msft commented on GitHub (Aug 4, 2021):

This probably is closely related, maybe even the same root cause, but I like having lots of test cases, and these are great repro steps. Thanks!

@zadjii-msft commented on GitHub (Aug 4, 2021): This probably is closely related, maybe even the same root cause, but I like having lots of test cases, and these are great repro steps. Thanks!
Author
Owner

@lhecker commented on GitHub (Aug 15, 2023):

I'm trying to reproduce this bug to test if #15701 fixed it but couldn't do manage to reproduce it. Does this bug still happen in 1.17/1.18?

@lhecker commented on GitHub (Aug 15, 2023): I'm trying to reproduce this bug to test if #15701 fixed it but couldn't do manage to reproduce it. Does this bug still happen in 1.17/1.18?
Author
Owner

@lhecker commented on GitHub (Aug 15, 2023):

BTW I think we should close this issue in favor of #10848. From what I can tell they're the same issue if anything. Also, I managed to reproduce something although not using the given instructions. I'll comment in #10848.

@lhecker commented on GitHub (Aug 15, 2023): BTW I think we should close this issue in favor of #10848. From what I can tell they're the same issue if anything. Also, I managed to reproduce _something_ although not using the given instructions. I'll comment in #10848.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Aug 19, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Aug 19, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Aug 19, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Aug 19, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14779