terminal: When Copying, Line Wrapped Text Is Inconsistently Broken Into Multiple Lines
Environment
Platform = Win32NT Version = 10.0.19041.0 Version String = Microsoft Windows NT 10.0.19041.0 Windows Terminal Version = 1.0.1811.0 SSH Version = OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5 WSL Version = 2
Steps to reproduce
- SSH into any linux server or open a WSL tab (My testing specifically used an SSH session).
- create a file called ‘test.txt’ containing a line long enough to wrap twice with the last wrap having just a few characters.
- Use
more test.txt
to list the contents of the create file. - Copy the output and paste it into notepad/notepad++
- Resize the Terminal Window (you can resize and then put it back to the same size)
- Copy the output again and paste it into notepad/notepad++
The ‘more’ command was the easiest way to get a reproducible result but I have seen this behavior with many other Linux programs some inconsistently and some consistently.
Expected behavior
Pasted text should be a single line, for both steps 4 and 6, as the copied output was wrapped by the terminal and not broken into separate lines by the output program.
Actual behavior
For step 4, the single line gets broken into multiple lines depending on the size or your terminal and how many lines the text got wrapped into. Then on step 6, the line is correctly copied as a single line.
Possible related to #5113 but was directed to create new issuel.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 22 (7 by maintainers)
The bad pasting might be “fixed”, but the real problem here is that there’s some inexplicable case where ConPTY hard line breaks a line when it really shouldn’t be. Or at least, that’s what I’m using this issue to track.