Feature request: Add redundant \r on line wrap #7242

Closed
opened 2026-01-31 00:58:47 +00:00 by claunia · 2 comments
Owner

Originally created by @rovf on GitHub (Apr 1, 2020).

This feature request evolves from a discussion about mintty (Cygwin) not working correctly with the new winpty anymore.The problem is that copying a line longer than the terminal width, which is being output by a typical Windows console (i.e. non-Cygwin) program from the mintty terminal, causes a hard line break being inserted in the copied string, because the controlling terminal (mintty in this case), can not recognize whether the line is really a long line having been wrapped around, or two short lines, where the first of these happened to be exactly the Window width.

I want to select with the mouse a long line which has been wrapped around, and paste it somewhere, without getting a hard line break at the point where the line wrap has occured.

Proposed technical implementation details (optional)

Since there seems to be no really good alternative, the mintty maintainer suggested that winpty would output \r\r\n, if there is a wrap around of the line. The redundant \r would signal to the controlling terminal, that a line wrap has occured.

Originally created by @rovf on GitHub (Apr 1, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> This feature request evolves from a [discussion about mintty (Cygwin) not working correctly](https://github.com/mintty/mintty/issues/971) with the new winpty anymore.The problem is that copying a line longer than the terminal width, which is being output by a typical Windows console (i.e. non-Cygwin) program from the mintty terminal, causes a hard line break being inserted in the copied string, because the controlling terminal (mintty in this case), can not recognize whether the line is really a long line having been wrapped around, or two short lines, where the first of these happened to be exactly the Window width. <!-- A clear and concise description of what you want to happen. --> I want to select with the mouse a long line which has been wrapped around, and paste it somewhere, without getting a hard line break at the point where the line wrap has occured. # Proposed technical implementation details (optional) Since there seems to be no really good alternative, the mintty maintainer suggested that winpty would output \r\r\n, if there is a wrap around of the line. The redundant \r would signal to the controlling terminal, that a line wrap has occured.
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 00:58:47 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 1, 2020):

So this is actually a bug that we're already tracking in #5113, and I'm trying to fix over in #5181. The real solution to this problem shouldn't be "add another hack to make this scenario work", the solution is just "don't hard break lines"

/dup #5113

p.s. winpty != conpty. winpty is a third party library for creating pseudoterminals on Windows, and ConPTY is the set of APIs that we maintain for hosting "pseudo-consoles". They're similar, but we only maintain conpty 😉

@zadjii-msft commented on GitHub (Apr 1, 2020): So this is actually a bug that we're already tracking in #5113, and I'm trying to fix over in #5181. The real solution to this problem shouldn't be "add another hack to make this scenario work", the solution is just "don't hard break lines" /dup #5113 p.s. winpty != conpty. winpty is a third party library for creating pseudoterminals on Windows, and ConPTY is the set of APIs that we maintain for hosting "pseudo-consoles". They're similar, but we only maintain conpty 😉
Author
Owner

@ghost commented on GitHub (Apr 1, 2020):

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!

@ghost commented on GitHub (Apr 1, 2020): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7242