https://stackoverflow.com/a/79004829/192798 worked for me. in my case, changing the setting and not restarting - caused vscode to crash when i tried to open a context menu.
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.