Open vfonic opened 2 years ago
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.68.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines.
Happy Coding!
@meganrogge I believe you might have misunderstood my issue. When pressing CMD+F, the old term is added to the clipboard and the old term is highlighted and searched for, not the new term that the user wanted to search for.
For example:
Please try to follow the repro steps to see how this bug happens.
@meganrogge this has been happening to me, too, and the repro that @vfonic describes is spot on. can you reopen this?
I still think that's as designed because the find widget uses the current terminal selection as the input for find
@meganrogge this isn't about using the current selection as the input for find, it's about any matches to what's in the find box overwriting the clipboard entry. this certainly wasn't the behavior in previous versions. here's a video to illustrate:
https://user-images.githubusercontent.com/7648957/173935510-bef58bf9-c0b9-49b8-81f6-c5bd8c364612.mov
@meganrogge did you try following the repro steps?
Thanks for the gif, yes we misunderstood. Re-searching after content is added to the terminal should not copy the text, only when the find is explicitly triggered.
this will be pretty involved currently - think we should fix it when we let each terminal have it's own find widget, #145865 because we'd need to do something like this and currently the instance doesn't have access to the find widget (it's owned by the tabs view)
Oh :/
I've downgraded in the meantime as this is a huge issue for my workflow.
I fully support terminal having its own search widget, because I'm also using some other customization that depends on "terminal being in focus" and that doesn't work when searching in terminal.
Thank you for looking into this!
My two cents is that even when find is explicitly triggered, a found selection's text should not be copied to the clipboard--maybe that's an easier fix?
Thanks for creating this issue, I've been bugged by "accidental" clipboard contamination with some random stuff and finally figured out where it's coming from. Hope it can be fixed soon.
What is the current status? Abandoned or added to a milestone?
still a pending bug in
Version: 1.79.0-insider Commit: f6be5461f8bc69013a605f5baea834651c6589fb Date: 2023-05-20T01:20:25.075Z Electron: 22.5.2 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Linux x64 5.15.0-72-generic
and extremely annoying also, took me like 10 attempts to figure out why the terminal keeps searching for something I did not put into the search field.
I think the problem lies in erroneous 'copy on selection' behaviour, when EACH focus on the terminal with active text selection copies the selected text again and again. The only time copying should be performed is when the selection ends (i.e. mouse up or whatever event is responsible for this), not each time terminal pane gets focus.
Moreover! This bug extends much further:
My clipboard history after typing in terminal search field:
See video below for explanation:
https://github.com/microsoft/vscode/assets/4336560/f30f214a-9f89-4b26-b130-1ae0f204cde6
Can the maintainers update us on when can this be scheduled for a fix.
unfortunately, the bug is still present.
When I leave the search box open and the terminal is set to copy on selection it frequently hijacks the clipboard and places the text in the search box in the clipboard.
Version: 1.86.0-insider Commit: df8db3a75a49b85c9636530a3557cdbc639f7bdc Date: 2024-01-01T05:35:59.858Z Electron: 27.1.3 ElectronBuildId: 25612240 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Linux x64 5.15.0-91-generic
+1 for the most recent comment, noticed it yesterday as well, very frustrating
@krasi-georgiev @movy any more info on the repro? I tried opening search, clicking between editor, terminal and search and couldn't get it to copy the text in the search box?
Thanks I can repro, I think what's happening is the the find is doing another search when the content changes and since the find widget isn't active it's getting copied to the clipboard.
@Tyriar
any more info on the repro?
Hey @Tyriar can you please tell me which of the repro steps I posted originally 2 years ago is confusing to you?
"terminal.integrated.copyOnSelection": true,
Here's the screen recording showing exactly these repro steps causing the bug: https://github.com/microsoft/vscode/assets/67437/ff749c31-30b1-4564-be2a-6e9a2daaa555
BTW I tested on VS Code 1.85.2 stable, but I've seen that someone else already tested on the latest insiders build and that the bug is still present.
@vfonic that bug was fixed in 1.86, @joelhock helped find the edge case that was missed.
@Tyriar indeed! I just tested it on the VS Code Insiders and the bug I mentioned with my repro steps is no longer happening! Thank you! 🙏
Finally! I was also struggling a lot in my workflow with this regression. Thanks a lot for fixing it! :pray: (and tnx @vfonic for reporting and providing repro instruction 🙂 )
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
"terminal.integrated.copyOnSelection": true,
Expected:
The pasted term is the term you just copied
Actual:
The pasted term is the term you last searched for (in step 3).
Why this happens?
Because:
"terminal.integrated.copyOnSelection": true,