terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Copy and paste newline behavior changes after certain programs are launched

Open sregister opened this issue 7 years ago • 2 comments

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.

sregister avatar Aug 11 '19 21:08 sregister

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 avatar Aug 11 '19 23:08 ghost

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 avatar Aug 12 '19 21:08 DHowett-MSFT