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

Copy Paste is from Terminal(Powershell) -> VSCode is just broken #9696

Closed
colemickens opened this issue Apr 2, 2021 · 13 comments
Closed

Copy Paste is from Terminal(Powershell) -> VSCode is just broken #9696

colemickens opened this issue Apr 2, 2021 · 13 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Question For questions or discussion Needs-Attention The core contributors need to come back around and look at this ASAP. 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. Resolution-Answered Related to questions that have been answered

Comments

@colemickens
Copy link

colemickens commented Apr 2, 2021

Windows Terminal version (or Windows build number)

1.7.572.0

Other Software

Nope, just plain old Powershell built into Win10

Steps to reproduce

Start Terminal.
Copy some text.
Paste it into VSCodium.

Expected Behavior

It is readable? Usable? Not useless?

Actual Behavior

It is indeed a single useless line of text.

I don't feel like I've always had this issue, maybe something bad slipped into the Preview builds? I don't know, for know I just am not using Terminal right now.

(Also, unrelated, but complete LOL at the fact that "Cod" still can't autocomplete to "VSCodium" in Win10. Stunning.)

@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 Apr 2, 2021
@colemickens
Copy link
Author

Well, even worse, it's seemingly rather inconsistent when making this repro video: https://youtu.be/YUTGcPrOueA (enjoy the extra win10 bug of being unable to close the Terminal repeatedly).

I can't tell what I'm doing differently between when it works correctly vs not.

@skyline75489
Copy link
Collaborator

You’re disappointed. I get it. But can you elaborate on the “useless text” part? A screenshot would be nice. I have no idea what exactly the issue is after reading all your complaints.

@skyline75489
Copy link
Collaborator

Oh. A YouTube video. Didn’t see that. But, I’m in China so that video can be problem for me.

@colemickens
Copy link
Author

colemickens commented Apr 2, 2021

Sometimes when you copy-paste from the terminal, it respects line breaks, other times it copies a single line of text with tons of spaces embedded. Sorry the emotion got in the way of a better issue description; a screenshot would've made sense. I can provide one now:

vscode-wrap

Again, sometimes it copies and pastes as expected, sometimes this, it's hard to tell when each will happen. When making this screenshot, it actually worked correctly several times before I stopped/restarted and then it reprod. (And the same behavior is observed with notepad.exe). (edit: when pasting into notepad, that is)

@237dmitry
Copy link

What the string is between Logo and prompt? If you are using custom $profile then maybe something wrong in it. Something that may affect the text being copied.

@colemickens
Copy link
Author

The string between the logo and the prompt is the output of ssh-add -l.

But, again, the video shows multiple attempts. All attempts include that line of text. And yet it only pastes correctly about half the time.

@zadjii-msft
Copy link
Member

Are you always copying in the same way? i.e. always pressing the same keybinding or always right clicking, with the same modifiers each time?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 6, 2021
@skyline75489
Copy link
Collaborator

Is #6901 somewhat related to this?

@zadjii-msft
Copy link
Member

Very likely, though, I'm more confused here that the same rows of text are sometimes copying with newlines and sometimes without. The bug that's hiding in #6901 seems more to be that conpty doesn't always mark the rows as wrapped correctly. In that case, the lines would consistently copy wrong, because they're in the buffer wrong. In this issue's case, the lines are sometimes copying with newlines and sometimes without, and that's mysterious and new.

@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Apr 12, 2021
@ghost
Copy link

ghost commented Apr 12, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@DHowett
Copy link
Member

DHowett commented Apr 12, 2021

We shouldn't necessarily let the bot mark this one just yet. Not sure whether this is a new issue or another face of 6901.

@DHowett DHowett removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Apr 12, 2021
@colemickens
Copy link
Author

Oh, I'm used to holding shift while selecting things (tmux, etc). So I hold shift, drag, right click.

If I'm still holding shift when I right click, it's copied as a single line. Now I'm worried this is maybe in fact expected behavior.

@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 Apr 13, 2021
@zadjii-msft
Copy link
Member

Now I'm worried this is maybe in fact expected behavior.

It most certainly is expected behavior:

https://github.com/microsoft/terminal/blob/main/src/cascadia/TerminalControl/TermControl.cpp#L1443

where shiftEnabled is filling the copySingleLine param. Glad we were able to figure this one out!

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Question For questions or discussion Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered labels Apr 13, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Question For questions or discussion Needs-Attention The core contributors need to come back around and look at this ASAP. 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. Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

5 participants