问题
Scenario: I am trying to copy something into Pycharm. When accidentally selecting something (even an empty line) in Pycharm, it gets copied and overwrites the buffer. Pasting then pastes the empty line (or whatever got selected) instead of what I copied originally.
Is it possible to avoid this behaviour?
回答1:
Press Ctrl+Alt+S to open the settings. Type "copy" into the search bar. Disable this checkbox:

回答2:
If you launch Pycharm using XServer, then the following worked for me (ref):
After experiencing the same problem on VcXsrv X server on Windows (which is a fork of Xming), the solution was to cancel the "Clipboard my use primary selection" option in VcXsrv tray icon context menu.
From the youtrack issue it looks like it was always an X server configuration problem.
I have also disabled Settings | Tools | Terminal | Copy to clipboard of selection option.
回答3:
To get the history of the clipboard press Ctrl + Shift + V or go to Edit
> Paste from History
,
This opens a dialog with previous copies which looks like this,
from the top box, select the relevant copy and press ok.
来源:https://stackoverflow.com/questions/39007903/pycharm-disable-copy-on-select-text