[Regressed in 19H1] When you copy text out of FAR manager, it gets line wrapped #10663

Open
opened 2026-01-31 02:26:53 +00:00 by claunia · 2 comments
Owner

Originally created by @DHowett on GitHub (Sep 18, 2020).

Originally assigned to: @lhecker on GitHub.

It appears that some time between RS5 and 19H1 we changed how line wrapping/unwrapping works and now FAR manager gets wrapped on copy.

Notes from internal filer

I'm on 3.0.0.5656 x64. I had repro with some older version as well, I installed the latest to check if it was fixed. Copy like you do in any other cmd window. For example, select any text file and press F3 to open the text viewer, or press CTRL+O to hide panels and view console / Far version. Now click on icon in left top corner of the window, then in menu select Edit -> Mark and select any text. Then paste the text in any other application like Notepad.

MSFT:28821591

Originally created by @DHowett on GitHub (Sep 18, 2020). Originally assigned to: @lhecker on GitHub. It appears that some time between RS5 and 19H1 we changed how line wrapping/unwrapping works and now FAR manager gets wrapped on copy. _Notes from internal filer_ > I'm on 3.0.0.5656 x64. I had repro with some older version as well, I installed the latest to check if it was fixed. Copy like you do in any other cmd window. For example, select any text file and press F3 to open the text viewer, or press CTRL+O to hide panels and view console / Far version. Now click on icon in left top corner of the window, then in menu select Edit -> Mark and select any text. Then paste the text in any other application like Notepad. MSFT:28821591
Author
Owner

@nico-abram commented on GitHub (Oct 23, 2022):

I tried to reproduce both via shift+select with mouse after Ctrl+O followed by ctrl+C and also by shift+right arrow key and ctrl+C in the Far text editor, and neither copied an extra line ending, and they correctly copied a line ending in the middle when I select two lines. I also tried vertical selection via alt+shift+click and it also seems to work OK.

@nico-abram commented on GitHub (Oct 23, 2022): I tried to reproduce both via shift+select with mouse after Ctrl+O followed by ctrl+C and also by shift+right arrow key and ctrl+C in the Far text editor, and neither copied an extra line ending, and they correctly copied a line ending in the middle when I select two lines. I also tried vertical selection via alt+shift+click and it also seems to work OK.
Author
Owner

@o-sdn-o commented on GitHub (Oct 24, 2022):

Perhaps this behavior is due to the fact that all EOL characters (CR and LF) are non-printable and cannot be in the scrollback buffer, and Far Manager uses ReadConsoleOutput Win32 API to capture the contents of the scrollback, and then possibly prints it as a rectangular block to the Ctrl+O screen. From the terminal's point of view, the content of the scrollback after that is a fullscreen rectangular area filled with colored cells (black is also a color; a whitespace is also a character). Therefore, logically, when you copy a linear selection with the terminal (e.g. Shift+LeftMouseDrag), the terminal should concatenate successive lines into one long line. While the terminal can apply some heuristics to detect line endings, this doesn't always work.

When you copy a rectangular selection block (using +Alt modifier), the terminal explicitly inserts a line endings after each copied row.

@o-sdn-o commented on GitHub (Oct 24, 2022): Perhaps this behavior is due to the fact that all EOL characters (CR and LF) are non-printable and cannot be in the scrollback buffer, and Far Manager uses ReadConsoleOutput Win32 API to capture the contents of the scrollback, and then possibly prints it as a rectangular block to the Ctrl+O screen. From the terminal's point of view, the content of the scrollback after that is a fullscreen rectangular area filled with colored cells (black is also a color; a whitespace is also a character). Therefore, logically, when you copy a linear selection with the terminal (e.g. Shift+LeftMouseDrag), the terminal should concatenate successive lines into one long line. While the terminal can apply some heuristics to detect line endings, this doesn't always work. When you copy a rectangular selection block (using +Alt modifier), the terminal explicitly inserts a line endings after each copied row.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10663