Selected block is copied as one line into clipboard #19686

Open
opened 2026-01-31 06:50:48 +00:00 by claunia · 0 comments
Owner

Originally created by @alabuzhev on GitHub (Apr 10, 2023).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.17.1023

Windows build number

10.0.19045.2728

Other Software

Far or any other TUI (mc, gdb etc.)

Steps to reproduce

  • Get the latest OpenConsole, either from the latest published WT package (1.17.2301.23004) or the latest source (e.g. ea44375f6d)
  • Get Far, any version will do.
  • Run OpenConsole, run Far in it
  • Alt-Space, Properties, uncheck "Enable line wrapping selection", OK
  • Alt-Space, Edit, Mark
  • Select an arbitrary part of the buffer, Enter
  • Paste the copied text somewhere, e.g. into Notepad.

Expected Behavior

The block shape is preserved: clipboard contains text split into multiple lines

Actual Behavior

The block shape is lost, clipboard contains text as one huge line without any line breaks

More

  • It works as expected in Windows 10 conhost (10.0.19041.2546).
  • It works as expected in cmd.exe, so, supposedly, it has something to do with how the app writes the output.
  • Commenting this line "fixes" it:
    ea44375f6d/src/buffer/out/textBuffer.cpp (L1854)
  • Taking into account "wrapping state" etc. probably makes sense when the whole rows are selected:
    image
    but if the user selects and copies an obvious "block", not even connected to the edges:
    image
    it probably should be copied as a block unconditionally.
Originally created by @alabuzhev on GitHub (Apr 10, 2023). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.17.1023 ### Windows build number 10.0.19045.2728 ### Other Software Far or any other TUI (mc, gdb etc.) ### Steps to reproduce - Get the latest OpenConsole, either from the latest published WT package (1.17.2301.23004) or the latest source (e.g. ea44375f6dcdfb3c8bdf05b2f02e38a72d2dde09) - Get [Far](https://farmanager.com/download.php?l=en), any version will do. - Run OpenConsole, run Far in it - Alt-Space, Properties, uncheck "Enable line wrapping selection", OK - Alt-Space, Edit, Mark - Select an arbitrary part of the buffer, Enter - Paste the copied text somewhere, e.g. into Notepad. ### Expected Behavior The block shape is preserved: clipboard contains text split into multiple lines ### Actual Behavior The block shape is lost, clipboard contains text as one huge line without any line breaks ### More - It works as expected in Windows 10 conhost (10.0.19041.2546). - It works as expected in cmd.exe, so, supposedly, it has something to do with how the app writes the output. - Commenting this line "fixes" it: https://github.com/microsoft/terminal/blob/ea44375f6dcdfb3c8bdf05b2f02e38a72d2dde09/src/buffer/out/textBuffer.cpp#L1854 - Taking into account "wrapping state" etc. probably makes sense when the whole rows are selected: ![image](https://user-images.githubusercontent.com/11453922/230973149-2270d7f9-5983-4f40-bd4d-ab601b1bceeb.png) but if the user selects and copies an obvious "block", not even connected to the edges: ![image](https://user-images.githubusercontent.com/11453922/230973181-f1539b32-eb33-4152-9f8d-98c144df18e3.png) it probably should be copied as a block unconditionally.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19686