Copy and paste newline behavior changes after certain programs are launched #3360

Closed
opened 2026-01-30 23:19:30 +00:00 by claunia · 2 comments
Owner

Originally created by @sregister on GitHub (Aug 11, 2019).

Environment

Microsoft Windows [Version 10.0.18362.239]
Windows Terminal (Preview)
Version: 0.3.2171.0

WSL Ubuntu 16.04.6
tmux 2.1 or htop 2.0.1 or vim

Steps to reproduce

  1. Launch WSL session in Windows Terminal
  2. Hit enter a few times to generate few lines of output
  3. Select the lines with mouse and right click to copy to clipboard:
    image
  4. Paste the lines into a different program, note that 4 distinct lines are pasted, this is expected behavior.
    image
  5. Launch vim (or other full screen application) inside the WSL window:
    image
  6. Close vim using esc q! enter
  7. Highlight and copy the lines again using mouse and right click:
    image
  8. Paste clipboard into different program, note that output is now on one line:
    image

Expected behavior

Launching programs inside the terminal should not impact how/when newlines are preserved.

Actual behavior

Newlines are preserved when copying multi-line output. After certain (fullscreen?) applications are launched they no longer are preserved and pasted output ends up on a single line.

Isolation notes

Vim isn't the only program this happens with. At first I noticed copy inside tmux wasn't working the way I expected but then I noticed it happens just by launching and closing programs like vim and htop. I did a quick scan over the other copy paste newline bugs and none of them described this behavior but I might have missed one; sorry if this is a duplicate but I don't think it is.

Originally created by @sregister on GitHub (Aug 11, 2019). # Environment Microsoft Windows [Version 10.0.18362.239] Windows Terminal (Preview) Version: 0.3.2171.0 WSL Ubuntu 16.04.6 tmux 2.1 or htop 2.0.1 or vim # Steps to reproduce 1) Launch WSL session in Windows Terminal 2) Hit enter a few times to generate few lines of output 3) Select the lines with mouse and right click to copy to clipboard: ![image](https://user-images.githubusercontent.com/1515124/62839560-54507a80-bc40-11e9-8eb6-17913a48b65d.png) 4) Paste the lines into a different program, note that 4 distinct lines are pasted, this is expected behavior. ![image](https://user-images.githubusercontent.com/1515124/62839568-6d592b80-bc40-11e9-84b3-40708d098324.png) 5) Launch vim (or other full screen application) inside the WSL window: ![image](https://user-images.githubusercontent.com/1515124/62839599-9d083380-bc40-11e9-9e1e-1eb74821009f.png) 6) Close vim using esc q! enter 7) Highlight and copy the lines again using mouse and right click: ![image](https://user-images.githubusercontent.com/1515124/62839620-d9d42a80-bc40-11e9-91ff-b7025f3348cb.png) 8) Paste clipboard into different program, note that output is now on one line: ![image](https://user-images.githubusercontent.com/1515124/62839622-f4a69f00-bc40-11e9-91a3-906258bae33c.png) # Expected behavior Launching programs inside the terminal should not impact how/when newlines are preserved. # Actual behavior Newlines are preserved when copying multi-line output. After certain (fullscreen?) applications are launched they no longer are preserved and pasted output ends up on a single line. # Isolation notes Vim isn't the only program this happens with. At first I noticed copy inside tmux wasn't working the way I expected but then I noticed it happens just by launching and closing programs like vim and htop. I did a quick scan over the other copy paste newline bugs and none of them described this behavior but I might have missed one; sorry if this is a duplicate but I don't think it is.
Author
Owner

@ghost commented on GitHub (Aug 12, 2019):

i have tested this in multiple unreal engine 4 versions and have confirmed this is a problem that needs to be fixed. i have spent hours in hammer editor to find a way to isolate the problem code and realized we need the source code for netconf to continue development on a solution.

Microsoft please help us!

@ghost commented on GitHub (Aug 12, 2019): i have tested this in multiple unreal engine 4 versions and have confirmed this is a problem that needs to be fixed. i have spent hours in hammer editor to find a way to isolate the problem code and realized we need the source code for netconf to continue development on a solution. Microsoft please help us!
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 12, 2019):

This is another version of #2275 actually. There's something about how the text enters the buffer that changes how it gets copied out.

@DHowett-MSFT commented on GitHub (Aug 12, 2019): This is another version of #2275 actually. There's something about how the text _enters the buffer_ that changes how it gets copied out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3360