You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift-insert should insert the PRIMARY clipboard on Linux, not the CLIPBOARD clipboard #36170
Select some text with the mouse. This puts it in the PRIMARY clipboard.
Press Shift+Insert.
In well-behaved Linux applications, this will paste in the text you just selected. In vscode, however, it pastes in the text in the CLIPBOARD clipboard. To insert the text in the PRIMARY clipboard, you must precisely position the mouse cursor and middle-click.
Reacted by Marsh Macy, Necdet Can Atesman, Алексей Тулинов, Cody Schafer, Per Lundberg, tobia, Paul Morelle, Pat Walsh, Arseniy Terekhin and lacky-yuity
Reacted by Vlad Alexeenkov, Stephen Seltzer and Simo Punnonen
To play the devil's advocate, "well-behaved Linux applications" are far and between nowadays.
Most applications, including all modern GTK apps and browsers, consider Shift+Insert as equivalent to Ctrl+V, probably to cater to Windows people who are used to that shortcut and are not accustomed to the concept of a dual clipboard.
That being said, terminal emulators and traditional Linux programs do make the distinction and developers and hackers make regular use of it.
As a comparison, Sublime Text has the same (broken) behavior by default (Shift+Ins = Ctrl+V) but allows changing it through the keybindings:
Daniel Imms (@Tyriar)Peng Lyu (@rebornix) Any updates on this? It's really frustrating to not be able to paste from the primary selection with keyboard. Right now, I have "solved" this by binding Shift-Insert to /usr/bin/xdotool click 2 in my GNOME settings, but the problem with that approach is that it will paste the content where the mouse cursor is located - not where the text cursor is located. So, a hack that doesn't fully work... 😢
There are some conflicts to resolve before merging since it's been so long, I will get to those hopefully sometime this week. Once I've done those I will ask for a review again.
Activity
tobia commentedon Oct 23, 2017
+1, I miss this feature too.
To play the devil's advocate, "well-behaved Linux applications" are far and between nowadays.
Most applications, including all modern GTK apps and browsers, consider Shift+Insert as equivalent to Ctrl+V, probably to cater to Windows people who are used to that shortcut and are not accustomed to the concept of a dual clipboard.
That being said, terminal emulators and traditional Linux programs do make the distinction and developers and hackers make regular use of it.
As a comparison, Sublime Text has the same (broken) behavior by default (Shift+Ins = Ctrl+V) but allows changing it through the keybindings:
danvk commentedon Oct 23, 2017
Regardless of what the correct behavior is, I'd like to have an editor action for "paste primary clipboard" so that I can configure this myself.
perlun commentedon Sep 10, 2018
FWIW - IntelliJ also has the same (broken and incorrect) behavior but can easily be dressed to act differently:
Note the difference between the "Paste" and "Paste from X Clipboard" actions; the latter is the missing functionality in VS Code at the moment.
perlun commentedon Oct 4, 2018
Daniel Imms (@Tyriar) Peng Lyu (@rebornix) Any updates on this? It's really frustrating to not be able to paste from the primary selection with keyboard. Right now, I have "solved" this by binding Shift-Insert to
/usr/bin/xdotool click 2in my GNOME settings, but the problem with that approach is that it will paste the content where the mouse cursor is located - not where the text cursor is located. So, a hack that doesn't fully work... 😢7 remaining items
perlun commentedon Nov 19, 2018
Middle-click works now already, yes, in the stable version of vscode.
sameer commentedon Nov 19, 2018
Good to hear -- I have a touchpad and it works when I click both left and right at the same time, wasn't sure about middle-click for mouse users.
tobia commentedon Nov 18, 2019
Thank you Sameer Puri (@sameer) for your contribution.
Today marks 1 year since the pull request was submitted. Which animal do you think we need to sacrifice for this request to be considered?
sameer commentedon Nov 19, 2019
There are some conflicts to resolve before merging since it's been so long, I will get to those hopefully sometime this week. Once I've done those I will ask for a review again.
Edit: PR is ready
Enable Shift-Insert to paste primary clipboard on Linux, fixes micros…
Enable Shift-Insert to paste primary clipboard on Linux, fixes micros…
Enable Shift-Insert to paste primary clipboard on Linux, fixes… (#63374)