Reputation: 622
I just started using Vscode on Ubuntu 18.0. I have the following problem. When I try to copy a particular line, when I click the right-click button on my mouse, the pop-up menu disappears instantly as soon as I release the right-click button. So if I want to copy or cut the selected line, I have to move the cursor while holding the right-click button. I did not like this behaviour. How can we change this to normal? That is the menu that comes when we click the right button on the mouse and it stays there until we close it by clicking somewhere else?
Upvotes: 17
Views: 12134
Reputation: 3575
Setting window.titleBarStyle to "custom" fixes the issue by making vscode use custom context menus it draws itself. After changing the setting, you must fully restart VSCode.
Upvotes: 2
Reputation: 21
Solved for me personally by setting
Ref: https://blog.rabu.me/vs-code-right-click-issue-on-linux/
Upvotes: 2
Reputation: 136
For me, uninstalling the extension Black Formatter for Python did the trick. I still have Python and Pylance installed as an extension.
It just works on Windows and Mac though. Good extension.
Upvotes: 0
Reputation: 381
Extensions just add items to right click menu, but main reason is strange behavior of mouse cursor after click. Sometimes cursor appears right over the menu item and "automatically" select it.
if without releasing the button immediately, move the cursor to the left and then release the button, the context menu does not disappear.
Upvotes: 1
Reputation: 337
This worked for me (Os: Ubuntu 20.04, vscode version: 1.71.0)
Disable Python and Jupyer extensions, and reload vscode window by ctrl
+ shift
+ p
and Reload Window
.
Upvotes: 1
Reputation: 8352
All of the existing answers propose to uninstall certain extensions, which does not help if I want / need to use these extensions.
Instead, I found that in this thread on github a better solution is proposed that is described in https://askubuntu.com/a/470219/75050. There, it is explained how to use the Easystroke Gesture Recognition to solve the problem. Reproducing the answer by kenn:
Install "Easystroke Gesture Recognition" from repository
sudo apt-get install easystroke
Open Easystroke and go to the preferences tab, click on "Gesture Button", and right click on the rectangular area to select the right mouse button.
In the "Timeout Profile" dropdown list pick up "Timeout Off"
This fixed the problem in VS code for me.
Upvotes: 14
Reputation: 11
I tested by disabling the Jupyter extension. The issue is fixed. Pylance and Python are remain activate in my case.
edit: Pylance causes the same issue only when selecting the commented code.
OS: Ubuntu 20.04.4, Snap version VS Code: 1.65.2
Upvotes: 1
Reputation: 31
I had a same issue. I think the reason of this error come from change of right click menu.
With this theory, I remove Jupyter extension because this extension change right click menu. (Also, I want to use Python extensions.) Then, "instantly disappeared right click menu" problem is solved for me.
Try to remove extension that change right click menu.
(My env: Ubuntu 18.04; VS Code 1.63.2)
Upvotes: 2
Reputation: 622
The problem was fixed when I uninstalled the extensions, Pylance and Python. Apparently, if we install these packages they directly alter even the basic things such as the right-click menu.
Upvotes: 10