Copying wrapped lines includes a newline character #22793

Closed
opened 2026-01-31 08:23:36 +00:00 by claunia · 6 comments
Owner

Originally created by @lindhe on GitHub (Jan 24, 2025).

Windows Terminal version

1.21.3231.0

Windows build number

10.0.22631.0

Other Software

Ubuntu 24.04.1 LTS (WSL2)

Steps to reproduce

  1. Type a long string, until it wraps at the window width:

    $ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    
  2. Select the text to copy it.

  3. Paste it, observe the newline introduced at the point of wrapping.

Expected Behavior

Copy the literal string, not the newline.

Actual Behavior

It copies a newline at the point of wrapping. In my example with my particular font and window size, it becomes:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaa
Originally created by @lindhe on GitHub (Jan 24, 2025). ### Windows Terminal version 1.21.3231.0 ### Windows build number 10.0.22631.0 ### Other Software Ubuntu 24.04.1 LTS (WSL2) ### Steps to reproduce 1. Type a long string, until it wraps at the window width: ```console $ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ``` 2. Select the text to copy it. 3. Paste it, observe the newline introduced at the point of wrapping. ### Expected Behavior Copy the literal string, not the newline. ### Actual Behavior It copies a newline at the point of wrapping. In my example with my particular font and window size, it becomes: ```text aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa ```
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 08:23:37 +00:00
Author
Owner

@similar-issues-ai[bot] commented on GitHub (Jan 24, 2025):

We've found some similar issues:

  • #12889 , similarity score: 85%
  • #14035 , similarity score: 83%
  • #16166 , similarity score: 82%
  • #5332 , similarity score: 82%
  • #5172 , similarity score: 81%

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@similar-issues-ai[bot] commented on GitHub (Jan 24, 2025): We've found some similar issues: - #12889 , similarity score: 85% - #14035 , similarity score: 83% - #16166 , similarity score: 82% - #5332 , similarity score: 82% - #5172 , similarity score: 81% If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue. > Note: You can give me feedback by 👍 or 👎 this comment.
Author
Owner

@lindhe commented on GitHub (Jan 24, 2025):

Very similar to #16166

@lindhe commented on GitHub (Jan 24, 2025): Very similar to #16166
Author
Owner

@DHowett commented on GitHub (Jan 24, 2025):

Can you try this again with Preview 1.22/? https://aka.ms/terminal-preview

@DHowett commented on GitHub (Jan 24, 2025): Can you try this again with Preview 1.22/? https://aka.ms/terminal-preview
Author
Owner

@lindhe commented on GitHub (Jan 27, 2025):

Seems to be working as intended in Preview.

@lindhe commented on GitHub (Jan 27, 2025): Seems to be working as intended in Preview.
Author
Owner

@carlos-zamora commented on GitHub (Jan 29, 2025):

Great! Thanks for verifying that! We'll close this as fixed 😊.

@carlos-zamora commented on GitHub (Jan 29, 2025): Great! Thanks for verifying that! We'll close this as fixed 😊.
Author
Owner

@lindhe commented on GitHub (Jan 30, 2025):

Considering this has been a recurring issue, would you consider adding some tests to catch it the next time it happens?

@lindhe commented on GitHub (Jan 30, 2025): Considering this has been a recurring issue, would you consider adding some tests to catch it the next time it happens?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22793