VtEngine: Console-style (undelayed) line wraps results in \r\n #20986

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

Originally created by @lhecker on GitHub (Dec 13, 2023).

Windows Terminal version

1.16.230126001

Windows build number

No response

Other Software

No response

Steps to reproduce

  • Use cmd.exe
  • Scroll at least 1 viewport down (hold Enter or Ctrl+C, etc.)
  • Type text until it line wraps
  • Copy the prompt to your clipboard

Expected Behavior

Clipboard contains 1 line of text without line wraps.

Actual Behavior

The clipboard is line wrapped at the right margin.

XtermEngine::_MoveCursor is called 3 times during the forced line wrap. When I type a single "a" at the end of the prompt, this results in 3 cursor movement sequences in total and the character being printed twice:

a\r\n\x1b[23;80Ha\r\n

I'm setting this to P2 because this bug has probably existed since the beginning. There might be a duplicate already.

Originally created by @lhecker on GitHub (Dec 13, 2023). ### Windows Terminal version 1.16.230126001 ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce * Use cmd.exe * Scroll at least 1 viewport down (hold Enter or Ctrl+C, etc.) * Type text until it line wraps * Copy the prompt to your clipboard ### Expected Behavior Clipboard contains 1 line of text without line wraps. ### Actual Behavior The clipboard is line wrapped at the right margin. `XtermEngine::_MoveCursor` is called 3 times during the forced line wrap. When I type a single "a" at the end of the prompt, this results in 3 cursor movement sequences in total and the character being printed twice: ``` a\r\n\x1b[23;80Ha\r\n ``` I'm setting this to P2 because this bug has probably existed since the beginning. There might be a duplicate already.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20986