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

Open
opened 2026-01-31 00:58:44 +00:00 by claunia · 0 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:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7239