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

Closed
opened 2026-01-31 03:38:49 +00:00 by claunia · 13 comments
Owner

Originally created by @colemickens on GitHub (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.)

Originally created by @colemickens on GitHub (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.)
Author
Owner

@colemickens commented on GitHub (Apr 2, 2021):

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.

@colemickens commented on GitHub (Apr 2, 2021): 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.
Author
Owner

@skyline75489 commented on GitHub (Apr 2, 2021):

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 commented on GitHub (Apr 2, 2021): 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.
Author
Owner

@skyline75489 commented on GitHub (Apr 2, 2021):

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

@skyline75489 commented on GitHub (Apr 2, 2021): Oh. A YouTube video. Didn’t see that. But, I’m in China so that video can be problem for me.
Author
Owner

@colemickens commented on GitHub (Apr 3, 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)

@colemickens commented on GitHub (Apr 3, 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](https://user-images.githubusercontent.com/327028/113460591-2d732900-93ce-11eb-9bb3-4131bea4b0d5.PNG) 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)
Author
Owner

@237dmitry commented on GitHub (Apr 3, 2021):

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.

@237dmitry commented on GitHub (Apr 3, 2021): 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.
Author
Owner

@colemickens commented on GitHub (Apr 3, 2021):

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.

@colemickens commented on GitHub (Apr 3, 2021): 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.
Author
Owner

@zadjii-msft commented on GitHub (Apr 6, 2021):

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 commented on GitHub (Apr 6, 2021): 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?
Author
Owner

@skyline75489 commented on GitHub (Apr 8, 2021):

Is #6901 somewhat related to this?

@skyline75489 commented on GitHub (Apr 8, 2021): Is #6901 somewhat related to this?
Author
Owner

@zadjii-msft commented on GitHub (Apr 8, 2021):

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.

@zadjii-msft commented on GitHub (Apr 8, 2021): 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.
Author
Owner

@ghost commented on GitHub (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.

@ghost commented on GitHub (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**.
Author
Owner

@DHowett commented on GitHub (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 commented on GitHub (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.
Author
Owner

@colemickens commented on GitHub (Apr 13, 2021):

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.

@colemickens commented on GitHub (Apr 13, 2021): 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.
Author
Owner

@zadjii-msft commented on GitHub (Apr 13, 2021):

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 commented on GitHub (Apr 13, 2021): > 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13287