-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Make middle-click do copy-and-paste in integrated terminal #187365
Comments
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
Info for implementor: This would mostly be a Windows feature that would sort of emulate the Linux OS-level selection clipboard feature. We might want to wait on #3130 |
That doesn't have to have anything to do with the clipboard. By default 'copy on selection' is enabled on Linux, and with that turned on, a middle click is nothing but a paste command. I think I will need to make some more experiments, especially with 'copy on selection' turned off. |
Tested on MATE terminal, Linux Mint 21.2 'Victoria' x86_64:
|
@lhmouse I misspoke, I mean the OS' "primary selection" which is often accessible via clipboard APIs. |
And for Windows, primary selection does not exist, so we would either want to emulate it (which sucks because it is not cross-app), or just hook up the regular clipboard. |
This is acceptable. The MSYS2 mintty, by configuration, assigns middle button the Paste command. So a middle click pastes the system clipboard; it's no difference from Ctrl-Shift-V or Shift-Insert. |
As a macOS user, I would also love to have middle-click paste similar to Linux functionality, but probably just pasting directly from clipboard similar to the aforementioned Windows implementation. See also this stackoverflow asking about it: https://stackoverflow.com/questions/69882273/how-to-enable-middle-mouse-button-click-to-paste-selected-text-in-vscodes-termi/72308315#72308315 They in turn pointed to some code which seems to hardcode for
|
I think I have to disable this on Linux (and consequently, on Windows too) for now, as the touchpad is very easily mishandled, causing vscode to paste text not only in the terminal, but in the editor area too. |
Any update on this? I work with vscode and "native" Linux shells side-by-side on a Windows workstation. This different behavior on what's essentially two windows for me is driving me crazy. |
Me, too. And the solution is to disable auto copy-on-select, and always copy explicitly with Ctrl-Insert and paste with Shift-Insert. It's cumbersome, but at least is consistent. |
I am kinda confused by this GitHub Issue, I thought that "middle-click to Paste" was already an available feature as per
However, searching for Also kinda confused because it seems like the desired behavior would be "copy on select" followed by "paste on middle-click". also kinda confused by this
been using Linux daily for many many years, I have never heard of a "traditional mouse button behavior" in Linux. Aren't these behaviors controlled by the third-party software such as your terminal emulator and desktop environment? If you are seeing some default behavior in your Linux installation, I am not sure that its coming from Linux itself, but from the third-party packages you are running which are not standardized. regardless of what is perceived as "traditional mouse button behavior" it seems like the "copy" and "paste" functionalities related to mouse behavior in the integrated terminal should be configured separately. So you can have "highlight on select" and "paste on middle-click", or whatever combination of actions, that you prefer |
@stevekm On Linux there are two clipboards, one is provided by X which can be printed with I am on Cinnamon so I take it as an example:
|
Thanks @lhmouse X is not a part of Linux. It is included in some desktop Linux distros but its not a core part of the Operating System. Linux desktop environments and desktop distro's are not standardized and are heavily influenced by whatever arbitrary combination of third-party packages their designers decide to include. It seems very strange and not quite appropriate to change the behavior of a cross-platform app like VS Code in response to a non-standard configuration of third party packages on a subset of distributions of an OS. This is why I suggest that the correct implementation of this is to allow for de-coupled behaviors for both copying and pasting. So that if one or the other or both are causing you problems on your specific combination of non-standard third party desktop environment packages, you can more easily choose the exact combination of configurations to suit your needs. Also I am refering to the "Copy On Select" setting in VS Code, not in your OS or desktop environment.
This is a VS Code Terminal setting. It does not cause text selected in e.g. the VS Code Editor to automatically copy.
If you are using copy-on-select, and you dont want some text to be copied, then just dont select it. If you accidentally selected the wrong text for copying, then just re-select the correct text. If you are worried about losing your clipboard contents, then make sure to Paste it before you make another selection. |
Maybe this is a dup of #26902.
The traditional mouse button for copy-and-then-paste on Linux is the middle button, while it is the right button on Windows. However, the notable MSYS2 terminal emulator, mintty, which is also utilized by the Git Bash, defaults to the linux configuration (but it's configurable). As a dual-platform user, having to be aware of this divergence is really a pain. Thus, I suggest we make this configurable, as I am more accustomed to the middle button.
The text was updated successfully, but these errors were encountered: