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

Middle click paste doesn't work on Linux #110

Closed
dflock opened this issue Nov 18, 2015 · 13 comments
Closed

Middle click paste doesn't work on Linux #110

dflock opened this issue Nov 18, 2015 · 13 comments
Assignees
Labels
feature-request Request for new features or functionality linux Issues with VS Code on Linux
Milestone

Comments

@dflock
Copy link

dflock commented Nov 18, 2015

On linux, whenever you select some text, this text is automatically placed onto a separate X11 clipboard called PRIMARY. This can then be pasted anywhere by middle clicking.

This works (pretty much) everywhere - including other electron apps like Atom - but doesn't work in Visual Studio Code, sadly.

VSCode Version:

Version 0.10.1
Commit df35236
Date 2015-11-17T15:21:23.766Z
Shell 0.34.1
Renderer 45.0.2454.85
Node 4.1.1

Linux Version:

Ubuntu 13.10

@bpasero bpasero self-assigned this Nov 19, 2015
@aniljava
Copy link
Contributor

Same problem in:

Version 0.10.1
Commit df35236
Date 2015-11-17T15:21:23.766Z
Shell 0.34.1
Renderer 45.0.2454.85
Node 4.1.1

Ubuntu 15.04

@pavlos256
Copy link

Please make it optional. Middle-click can happen by accident when scrolling.

@dflock
Copy link
Author

dflock commented Nov 19, 2015

It's not optional in any other linux software that I know of?

@bpasero bpasero assigned alexdima and unassigned bpasero Nov 22, 2015
@alexdima
Copy link
Member

Just to be sure I do the right thing:

The change should be: "middle click should be bound to paste in Linux" (i.e. what Ctrl-V does)

@dflock
Copy link
Author

dflock commented Nov 24, 2015

Nope.

Linux, via XWindows, has multiple clipboards. One called CLIPBOARD is used for Windows style ctrl+c, ctrl-v copy & paste. One called PRIMARY is used to do middle click paste. This works like this:

  • You select some text somewhere. This selection is automatically copied to the PRIMARY clipboard, live, as you're selecting it. This just happens without the user doing anything, other than selecting text.
  • When you middle click somewhere, the contents of the PRIMARY clipboard are inserted at the cursor.

You just have to implement/support the second step.

Like I said, Atom, which is also based on electron and is open source - supports this correctly; so I might be possible to look at their implementation? They're also MIT licensed I think, so that shouldn't be a problem.

@alexdima alexdima added the feature-request Request for new features or functionality label Nov 25, 2015
@alexdima alexdima removed their assignment Dec 8, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@Tyriar Tyriar added the linux Issues with VS Code on Linux label Feb 3, 2016
@zevero
Copy link

zevero commented Feb 9, 2016

👍
Middle click already works for pasting the filename to create a new file...

@honzahana
Copy link

Version 0.10.8 still not works (Ubuntu 14.04). Hope VSC has faster support team then Skype (bugs 2 years old not fixed).

@jcward
Copy link

jcward commented Mar 16, 2016

Yes, it's not the same as paste -- the dual clipboard thing is often irritating, but at least standard on Linux. I use it all the time.

I'd assume it's a high-level X-windows function. Something high-level in the code must be actively blocking it for the editor portions of the window. Because it works to middle-click paste into this pop-up text input:

image

And it works in the find/replace pop-up dialog's text inputs:

image

ETA: Interesting to note -- selecting text in the editor pane is also not populating the PRIMARY clipboard. While it does populate when highlighting text in the find/replace dialogs. So it's as if the primary clipboard functionality (both copy and paste) is entirely disabled for the editor pane.

@lianghu
Copy link

lianghu commented Mar 18, 2016

It's still not working in the Feb release.

@alexdima
Copy link
Member

With the March release, it will be under a setting called "editor.selectionClipboard", which is off by default until we better understand the perf implications of writing to the clipboard on every selection change.

@zevero
Copy link

zevero commented Apr 6, 2016

It is working great!
Thank you!

@Tyriar
Copy link
Member

Tyriar commented Apr 7, 2016

@alexandrudima I've had it turned on for a while now and haven't had any issues. I don't use it often, I've probably used it around 4-5 times spread out across that time. Do you think it's safe to turn on by default?

@alexdima
Copy link
Member

alexdima commented Apr 8, 2016

👍 My concern was with any negative perf impact (writing to the clipboard on every selection change), but if you've used it and all looks good then let's turn it on by default

@alexdima alexdima modified the milestones: April 2016, Backlog Apr 8, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality linux Issues with VS Code on Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.