aaronpowell / vscode-profile-switcher

A VS Code extension for switching settings easily
https://marketplace.visualstudio.com/items?itemName=aaronpowell.vscode-profile-switcher&wt.mc_id=profileswitcher-github-aapowell
MIT License
177 stars 19 forks source link

Relying on `process.execPath` incorrectly detects vscode version #46

Open dithpri opened 3 years ago

dithpri commented 3 years ago

The extension checks if it runs in VSCode/VSCode insiders/VSCodium by checking the name of its binary. This is not a reliable way to detect the Code branding used. For example, in my case, process.execPath is just /usr/lib/electron11/electron. Furthermore, the editor is launched with /usr/bin/code, which is a symlink to /usr/bin/code-oss.

A better way would to check this would be to test vscode.env.appName for Code - OSS or VSCodium, etc..

Related: #42 #12