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

Ctrl+f overwrites X11's Primary selection buffer. #130208

Open
lvella opened this issue Aug 5, 2021 · 3 comments
Open

Ctrl+f overwrites X11's Primary selection buffer. #130208

lvella opened this issue Aug 5, 2021 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-clipboard Editor clipboard issues editor-find Editor find operations linux Issues with VS Code on Linux

Comments

@lvella
Copy link

lvella commented Aug 5, 2021

  • VS Code Version:

Version: 1.58.2
Commit: c3f1263
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.4.0-80-generic snap

  • OS Version: Ubuntu 20.04.2 LTS + XFce

When first exposed to X11, most people will figure out that you can paste your last selection with mouse's middle click. Many will hate the feature and disable it (so much that Ubuntu 20.04 has disabled it by default), others will learn to live with it, but a few will learn to use and depend on it. I belong in this last group, and I am used to have 2 copy paste buffers: one long term (the normal ctrl+c → ctrl+v CLIPBOARD buffer), and one short term (the select → middle click PRIMARY buffer). With a few exceptions, it works transparently with most applications, but in vscode, the Find (ctrl+f) functionality disrupts the primary buffer by replacing its contents to whatever ends up being seeded in the find box.

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Make sure you have middle click paste enabled (the default in most distros I have used in the past 20 years, but I am not so sure about recent ones). This is how to do it in Ubuntu's Gnome.
  2. Select any text, inside or outside vscode;
  3. Middle-click several times to confirm you can paste from the PRIMARY buffer, inside or outside the vscode
  4. Press ctrl+f in another vscode editor tab, where the cursor is over a different string (the intention is that you can middle-click and find the string you have previously selected);
  5. Middle-click in the editor, to surprisingly find that the contents of your PRIMARY buffer has been replaced by the pre-filled contents of the Find box.

I think this is a bug because the pre-filling of the find box is certainly not intended to replace the user's copied content (and it should not).

BTW, I also think that the find box should be pre-filled with the contents of the PRIMARY buffer, but maybe that should be a feature request ticket.

This is somewhat related to Issue #20768.

References os this PRIMARY buffer thing:

@alexdima
Copy link
Member

@rebornix I think we have some find options that would prevent the current word from being selected in the editor when pressing ctrl+f?

@alexdima alexdima assigned rebornix and unassigned alexdima Sep 30, 2021
@alexdima alexdima added editor-find Editor find operations linux Issues with VS Code on Linux labels Sep 30, 2021
@rebornix
Copy link
Member

You can set "editor.find.seedSearchStringFromSelection": "selection" to force the editor to prefill the find input box only when the text is selected, or use "editor.find.seedSearchStringFromSelection": "none" to disable this feature completely.

@lvella
Copy link
Author

lvella commented Apr 23, 2024

This is also very annoying when I open the Search tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug editor-clipboard Editor clipboard issues editor-find Editor find operations linux Issues with VS Code on Linux
Projects
None yet
Development

No branches or pull requests

3 participants