You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing extensions the editor's context menu may become really bloated and hard to reach.
Extensions authors usually give the option the remove their menu items, but it would be nice to be able to remove the default ones.
I usually not using any of the Copy/Cut/Paste menus, and I certainly not using the Command Palette... item (when I use the command palette my hands are already on the keyboard).
(This issue is similar to #3874, but for the context menu)
Reacted by zhuhaiyang, Paola (Alma) Captanovska, Gio Romanadze, T, Michal Čaplygin, douira, Alberto Fabbri, Marco Coraggio, vakokako, peter-fb and 30 more
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
I'm also interested in this. Some extensions add context menu entries that I don't want or are just in the way. There should be a settings option where I can disable specific menu entries manually or for entire extensions. This issue should be reopened. This is not the same as #9285 which is about adding custom context menus instead of disabling.
Reacted by peter-fb, Damilola Emmanuel Olowookere, Jiansheng Qiu, Dan, Jesse Boyer , josephmyers, AntonyGon and Hendrix4858
I think a very good starting point would be being able to disable the default entries and then later implement a general interface for all of them (built-in + contributed by extensions).
+1 to reopening this. I want to arrange and add/remove context menu items in a way that makes sense for my workflow. And for tabs context menu items too.
Related (context menu customization request): #132752
Why is this issue closed, and why are "duplicates" of this issue closed? Context menu is simply too big.
I personally don't need much customization, but it should be clear if the context menu takes up more space than the screen height, something is not going well. It makes the context menu useless if I have to search for various functions.
SteVen Batten (@sbatten) you closed issue #171906 as a duplicate of this one, but this one is already closed. Would you mind reopening this issue because it is clearly not solved.
Reacted by Urist McUristurister, Yuki2718, Syul968, Eli Ferguson, Rahul Sharma, 是虹川肉, Probhonjon Baruah, Baptiste Roux, Andrew Cudworth, Readme0 and 13 more
There should be a function to hide all context menus brought by an extension, or more flexible, to disable or remove certain menus as needed, just like the software RightMenuMgr on Windows.
Please prioritize this. Peng Lyu (@rebornix)SteVen Batten (@sbatten). My Context menu is basically unusable right now. The menu covers the whole page, and I still have to scroll. 😂
Reacted by Readme0, Yuki2718, perspicacitee, Adriano M., Diana, AntonyGon, shrnv99, Antagony1060 and Louis Duret-Robert
Reacted by Urist McUristurister, Readme0, Антониус and Julian Schmidt
Here is my script to hide some context menu items:
/*Hide context menu items in vscode.`Reload Custom CSS and JS` to apply changes.Tricks: Help > Toggle Developer Tools, run `setTimeout(() => { debugger }, 3000)` in Console, open the context menu within 3 seconds, wait for the debugger to pause, then inspect items in Elements.*/(function(){console.log("Hello from custom_context_menu.js~");constselectors=['^"Go to"',// start with "Go to"'"Change All Occurrences"',// exact match'"Share"','"Share" + "_"',// separator after "Share"'"_":has( + "Share")',// separator before "Share"'"Command Palette..."','"_":has( + "Command Palette...")','"Layout Controls"',];constcss_selectors=selectors.join(",\n").replaceAll(/([*^|])?"(.+?)"/g,'[aria-label\x241="\x242"]');console.log(css_selectors);functionwait_for(root){constselector=".monaco-menu-container > .monaco-scrollable-element";newMutationObserver((mutations)=>{for(letmutationofmutations){for(letnodeofmutation.addedNodes){if(node.matches?.(selector)){// console.log(">>", node);modify(node);}}}}).observe(root,{subtree: true,childList: true});}// context menu in editorElement.prototype._attachShadow=Element.prototype.attachShadow;Element.prototype.attachShadow=function(){constshadow=this._attachShadow({mode: "open"});wait_for(shadow);returnshadow;};// context menu in other placeswait_for(document);// get mouse positionletmouse_y=0;document.addEventListener("mouseup",(e)=>{// bug: not working in titlebarif(e.button===2){mouse_y=e.clientY;// console.log("mouse_y", mouse_y);}});functionmodify(container){if(container.matches('.titlebar-container *')){// console.log("skip titlebar");return;}for(letitemofcontainer.querySelectorAll(".action-item")){constlabel=item.querySelector(".action-label");constaria_label=label?.getAttribute("aria-label")||"_";item.setAttribute("aria-label",aria_label);}constmenu=container.parentNode;conststyle=document.createElement("style");menu.appendChild(style);style.innerText=` :host > .monaco-menu-container, :not(.menubar-menu-button) > .monaco-menu-container {${css_selectors}, .visible.scrollbar.vertical, .shadow { display: none !important; } } `.replaceAll(/\s+/g," ");// fix context menu positionif(menu.matches(".monaco-submenu")){return;}letmenu_top=parseInt(menu.style.top);constmenu_height=menu.clientHeight;// console.log("menu_top", menu_top, "menu_height", menu_height);consttitlebar_height=40;constwindow_height=window.innerHeight;if(menu_top<titlebar_height&&menu_height<90){mouse_y=menu_top;}else{if(mouse_y<window_height/2){menu_top=mouse_y;if(menu_top+menu_height>window_height){menu_top=window_height-menu_height;}}else{menu_top=mouse_y-menu_height;if(menu_top<titlebar_height){menu_top=titlebar_height;}}menu.style.top=menu_top+"px";}}})();
Activity
vscodebot commentedon Jun 22, 2019
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
vscodebot commentedon Oct 8, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!
douira commentedon Oct 6, 2021
I'm also interested in this. Some extensions add context menu entries that I don't want or are just in the way. There should be a settings option where I can disable specific menu entries manually or for entire extensions. This issue should be reopened. This is not the same as #9285 which is about adding custom context menus instead of disabling.
AlbertoFabbri93 commentedon Nov 10, 2021
I think a very good starting point would be being able to disable the default entries and then later implement a general interface for all of them (built-in + contributed by extensions).
alfuken commentedon Jul 5, 2022
+1 to reopening this. This kind of functionality is pretty logical to have.
Syul968 commentedon Jul 8, 2022
+1 to reopening this. I want to arrange and add/remove context menu items in a way that makes sense for my workflow. And for tabs context menu items too.
Related (context menu customization request): #132752
yiliang114 commentedon Jan 17, 2023
I also have the need to hide menus, built-in menus or other extended menus, users should be able to configure ignore not to display them.
bigsnowballhehe commentedon Mar 20, 2023
need this
Yuki2718 commentedon Apr 14, 2023
+1 for this, over time more and more items have been added which I never use and they're annoying,
akors commentedon May 2, 2023
Why is this issue closed, and why are "duplicates" of this issue closed? Context menu is simply too big.
I personally don't need much customization, but it should be clear if the context menu takes up more space than the screen height, something is not going well. It makes the context menu useless if I have to search for various functions.
SteVen Batten (@sbatten) you closed issue #171906 as a duplicate of this one, but this one is already closed. Would you mind reopening this issue because it is clearly not solved.
fa1247 commentedon Jul 13, 2023
There should be a function to hide all context menus brought by an extension, or more flexible, to disable or remove certain menus as needed, just like the software RightMenuMgr on Windows.
bigfoot31 commentedon Jul 19, 2023
Please prioritize this. Peng Lyu (@rebornix) SteVen Batten (@sbatten). My Context menu is basically unusable right now. The menu covers the whole page, and I still have to scroll. 😂

fipppi commentedon Nov 23, 2023
+1 🥴

gohilurvish commentedon Feb 22, 2024
While I also wants to remove Cut/Copy/Past and some other stuff from the right-click menu, the major issue was commands added by extensions.
The workaround I am using is : Delete the items added by extensions.
On mac:
Long0x0 commentedon Aug 26, 2024
Thanks to Belleve (@be5invis) we have greasemonkey/tampermonkey for vscode: vscode-custom-css.
Here is my script to hide some context menu items:
Delapouite commentedon Sep 27, 2024
Work is under way to clean the context menu #225411
BHznJNs commentedon Dec 26, 2024
Long Chen (@Long0x0) Thank you for your code snippet, I made an extension that used it and can partially make the contextmenu cleaner: https://github.com/BHznJNs/vscode-custom-contextmenu