Extraneous newlines are inserted when the window scrolls #21956

Open
opened 2026-01-31 07:59:19 +00:00 by claunia · 0 comments
Owner

Originally created by @ion201 on GitHub (Jul 11, 2024).

Windows Terminal version

1.20.11381.0

Windows build number

10.0.22631.3737

Other Software

cmd.exe and ssh in windows terminal

Steps to reproduce

  1. Open command prompt and make the window as small as possible (doesn't have to be, just makes it easier to demonstrate)
  2. Tap enter until the window starts to scroll - the cursor is now at the bottom of the window
  3. Type until the line wraps (typing "11111....22222" below). Then hit ctrl+c to start a new line
  4. Do the same as (3) again (typing "3333.....44444" below), but this time hit backspace after the line wraps so the cursor goes back to the first line. Then type the text again so the line wraps (so this time the window already scrolled when we wrap to the new line).
  5. Resize the terminal larger

Expected Behavior

Text should be preserved without inserting extra newlines

Actual Behavior

Command window contents after resizing larger:

C:\>
C:\>11111111111111111111111111111111111112222222
22222222222222222222222222222
C:\>
C:\>333333333333333333333333333333333333333334444444444444
C:\>

An erroneous newline is inserted in the first text but not in the second. The observed difference being that the "111....2222" text caused the window to scroll more, but "33333....44444" did not.

This issue is not reproducible in cmd.exe if run in "conhost", only in windows terminal.

Originally created by @ion201 on GitHub (Jul 11, 2024). ### Windows Terminal version 1.20.11381.0 ### Windows build number 10.0.22631.3737 ### Other Software cmd.exe and ssh in windows terminal ### Steps to reproduce 1. Open command prompt and make the window as small as possible (doesn't have to be, just makes it easier to demonstrate) 2. Tap enter until the window starts to scroll - the cursor is now at the bottom of the window 3. Type until the line wraps (typing "11111....22222" below). Then hit ctrl+c to start a new line 4. Do the same as (3) again (typing "3333.....44444" below), but this time hit backspace after the line wraps so the cursor goes back to the first line. Then type the text again so the line wraps (so this time the window already scrolled when we wrap to the new line). 5. Resize the terminal larger ### Expected Behavior Text should be preserved without inserting extra newlines ### Actual Behavior Command window contents after resizing larger: ``` C:\> C:\>11111111111111111111111111111111111112222222 22222222222222222222222222222 C:\> C:\>333333333333333333333333333333333333333334444444444444 C:\> ``` An erroneous newline is inserted in the first text but not in the second. The observed difference being that the "111....2222" text caused the window to scroll more, but "33333....44444" did not. This issue is not reproducible in cmd.exe if run in "conhost", only in windows terminal.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:59:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21956