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

Copying wrapped lines in cygwin can have a spurious space/newline between lines #5760

Closed
brendanmig opened this issue May 6, 2020 · 6 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.

Comments

@brendanmig
Copy link

brendanmig commented May 6, 2020

Environment

Platform ServicePack Version      VersionString
-------- ----------- -------      -------------
 Win32NT             10.0.18363.0 Microsoft Windows NT 10.0.18363.0

Windows Terminal
Version: 0.11.1191.0

Steps to reproduce

Open a cygwin terminal and enter a long line that wraps the terminal. If you then select the entire wrapped line you see an extra space is selected where the line wraps. This does not occur in a normal cmd terminal. When you copy the long cygwin line it also copies the space, and the newline, into the clipboard, so when you paste you end up getting 2 lines with an extra space.

Expected behavior

Expected behaviour is that the text is copied as a single line without a spurious space.

Actual behavior

That it behave like in the cmd window. The extra space at the end of the line should not be selected. And when copied the space and newline should not be in the clipboard. This is a very annoying issue as copying and pasting commands from one terminal to another fails as it ends up pasting two lines which get run as two invalid commands.

Multiline selection in cygwin:
image

Notice the highlighted space at the end of the first line.

Multiline selection in CMD:
image

Notice how there is no highlighted space at the end of the first line.

Pasted text from both examples in Sublime Text:
image

Note how the cygwin text is over two lines whereas the CMD isn't.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 6, 2020
@zadjii-msft
Copy link
Member

@brendanmig What version of cygwin are you running?

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. labels May 6, 2020
@brendanmig
Copy link
Author

It's an old one since I don't like updating cygwin :) I guess I should update to the latest though and try again. In any case it's:

bendy@eric ~
$ cygcheck -V
cygcheck (cygwin) 2.10.0
System Checker for Cygwin
Copyright (C) 1998 - 2018 Cygwin Authors
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bendy@eric ~
$ uname -a
CYGWIN_NT-10.0-WOW eric 2.10.0(0.325/5/3) 2018-02-02 15:21 i686 Cygwin

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 6, 2020
@DHowett-MSFT
Copy link
Contributor

so, I’ve got some bad news. This might be the same as explained in #3367 (comment) — the MSYS runtime and the Cygwin runtime are one and the same. This is something an update might help with, but something Terminal is totally powerless to help.

@brendanmig
Copy link
Author

Well I just updated to cygwin64 (3.1.4) and it seems to have solved the problem. I use this as the profile:

            {
                // Make changes here to the cmd.exe profile
                "guid": "{0caa0dad-35be-5f56-58ff-afceeeaa6102}",
                "name": "cygwin64",
                "commandline": "C:\\cygwin64\\bin\\bash --login -i",
                "startingDirectory": "c:\\cygwin64\\bin",
                "icon": "c:\\cygwin64\\Cygwin-Terminal.ico",
                "hidden": false
            }, 

Which is the same as the 32 bit one except cygwin64 instead of cygwin.

In a cygwin64 tab the multiline selection is fine. In a cygwin one it isn't. Maybe they fixed or updated something internally.

@DHowett-MSFT
Copy link
Contributor

I believe the runtime changes in 3.1 helped fix this. Thanks for confirming!

@brendanmig
Copy link
Author

Thanks for your fast response! This issue has been bugging me since I started using WT back in Jan, glad just a quick update could fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants