Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where text copied to clipboard doesn't have line endings #3239

Merged
merged 1 commit into from
Oct 18, 2019
Merged

Conversation

d-bingham
Copy link
Contributor

@d-bingham d-bingham commented Oct 17, 2019

Summary of the Pull Request

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

Fixes issue with console text copied to the clipboard not having correct line endings.

It appears the primary cause of the problem was the text erase code was using the default setting of the wrapped-text flag -- that is, when it erased lines (or the whole screen), it cleared cells up until the end of the line, and without end-of-line wrapping explicitly disabled, the rows with erased text all thought there was a wrapped line because the last cell in each row was written to...

Validation Steps Performed

  1. Open up a Terminal window (for this example, a WSL instance)
  2. Hit enter a couple of times to generate some duplicates of the prompt to copy/paste
  3. Select multiple lines, copy, paste to Notepad
  4. Note that the lines include line breaks as expected
  5. Clear the terminal by the clear command
  6. Hit enter a couple of times to generate some prompts
  7. Select multiple lines, copy, paste to Notepad
    8a) Note that in the unmodified version of Terminal, these lines have no line breaks
    8b) Note that in the patched version of Terminal, line breaks exist

Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!!

@carlos-zamora this fits in with our understanding of the world, right? we fixed the same bug in conhost, but forgot to propagate that fix to windows terminal? :O

@DHowett-MSFT DHowett-MSFT changed the title Fixes issue with text copied to clipboard not having proper line endi… Fix issue where text copied to clipboard doesn't have line endings Oct 17, 2019
@DHowett-MSFT
Copy link
Contributor

Of course! Our fixes conspired against eachother. #2831 plus #2797!

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. This is what happens when you work on two very similar bugs in two very similar projects at very similar times. Thanks for submission! @DHowett-MSFT and @miniksa can we get this in for 0.6 plz?

@carlos-zamora carlos-zamora merged commit 5c55bb8 into microsoft:master Oct 18, 2019
@DHowett-MSFT
Copy link
Contributor

Yep this is tagged in for 0.6

@stevenh
Copy link

stevenh commented Oct 18, 2019

Thanks this fix!

It seemed totally random, sometimes worked some times didn't, thought I was going mad ;-)

Do you have an ETA on 0.6 release, as would love to get a fix for this.

@miniksa
Copy link
Member

miniksa commented Oct 18, 2019

@stevenh, we're trying to get 0.6 out next week. Hopefully Tuesday. Might slip a day or two since we've got a bunch of folks on vacation or sick.

@conioh
Copy link

conioh commented Oct 21, 2019

Does this also fix the window resize bug?

@ghost
Copy link

ghost commented Oct 23, 2019

🎉Windows Terminal Preview v0.6.2951.0 has been released which incorporates this pull request.:tada:

Handy links:

@guillemcanal
Copy link

guillemcanal commented Oct 25, 2019

Hi, I made a test just this morning and it don't seems to work. Please find attached a short clip of the issue. CRLF don't seems to be replaced by LF in when text is pasted into WindowsTerminal.

@DHowett-MSFT
Copy link
Contributor

This bug report is about copying. Your bug report is about pasting. There’s already a hundred reports of that on this tracker. Thanks!

@guillemcanal
Copy link

guillemcanal commented Oct 25, 2019

This bug report is about copying. Your bug report is about pasting. There’s already a hundred reports of that on this tracker. Thanks!

Oh! I didn't quite get the meaning of the issue as explained by @d-bingham. I feel sorry about that. Thanks for clarifying ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy and paste from the Windows Terminal doesn't include line breaks
7 participants