Problem
I have the setting "Settings | Tools | Terminal | Copy to clipboard on selection" turned on
When I use IntelliJ built-in Terminal in Mac or Windows, and press Ctrl+V or Cmd+V, the text selected in Terminal is pasted.
When I use IntelliJ built-in Terminal in Linux, and press Ctrl+V, the text selected in Terminal is not pasted.
Cause
On Linux, there are two types of clipboard: "Primary Selection" and "Clipboard Buffer" (description). Selected text goes to Primary Selection after you finished selecting. When you press Ctrl+C, it goes to Clipboard Buffer.
On Linux, when you click the middle mouse button, the content from the primary selection is pasted. When you press Ctrl+V, the content from the clipboard buffer is pasted.
On Mac and Windows, there is only "Clipboard buffer". If you turn on "Copy to clipboard on selection" setting, the selected text will be copied to "Clipboard buffer" without Ctrl+C or Cmd+C.
Solution
Though many Linux users prefer having two different buffers for the terminal, one can still merge them through the keymap configuration.
- Go to "Settings | Keymap" and find the action "Paste from X clipboard".
-
Right-click on the action name and select "Add keyboard shortcut". Add
Ctrl+V. -
You will see the dialog:
-
Choose "Keep" to keep your primary assignment.
-
Click "OK" to save the keymap. Now you can use
Ctrl+Vto paste the selected text in the Terminal if "Settings | Tools | Terminal | Copy to clipboard on selection" is turned on.
Note: this does not apply to the IntelliJ Editor or other tool windows.
Comments
0 comments
Please sign in to leave a comment.