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

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

No dependencies set.

Reference: starred/terminal#3354