2

I have a shortcut that I use to open Windows Terminal with elevated privileges. This is preferred 9 time out of 10 because I perform a lot of tasks that need admin privileges. The problem I am having is that when I open a new terminal tab for my WSL distro, and then for instance I open a folder is the Ubuntu filesystem in VScode using code ./myFolder, it runs VScode as Administrator. I know the reason is because I am running Windows Terminal with elevated privileges. I am still logged in to WSL as my user (not root) but when I open Windows apps from WSL (like VScode) they open as Administrator. Now whenever I create a file (or use an extension that creates files and/or directories) from within VScode, it is automatically owned by root.

My question is: Is there a way to open certain Windows Terminal profiles with elevated privileges and some without them?

ghood97
  • 161
  • 1
  • 12

0 Answers0