5

I can use the terminal in VSCode and the terminal has Full Disk Access, so does VSCode have Full Disk Access?

Can VSCode and extensions run terminal commands?

0

2 Answers 2

3

That is a mix of misconceptions.

You do not run Terminal in VSCode. Vscode calls macOS to request macOS to launch Terminal. So VSCode does not have Full Disk Access that way.

VSCode also can run command line tools directly not via Terminal. These tools might need Full Disk Access which I think can is done by giving VSCode Full Disk Access.

VSCode also might need Full Disk Access to access files in various different places on the disk.

Except for a few special cases for an App to get Full Disk Access requires the user to manually give it. This is via System Preferences->Security & Privacy -> Full Disk Access

Note I don't use VSCode at the moment but this is the setup for my programming editors.

3
  • I guess when user run a command in a terminal inside VSCode, it passes user input to the terminal app, but is it technically possible that VSCode run commands not entered by the user?
    – TNKYM
    Commented Feb 17, 2021 at 17:07
  • I don't know the details for VSCode - but an editor can definitely run things not through the terminal (usually a compile will not be through Terminal.app) also they can have windows that are terminals but are not Terminal.app
    – mmmmmm
    Commented Feb 17, 2021 at 17:16
  • @TNKYM No, Terminal.app is not involved. Why would it be? VS Code provides an environment to run a shell and connects STDIN and STDOUT to it. Commented Oct 14, 2021 at 16:26
2

You will need to provide the VSCode full disk access so the integrated terminal can execute the commands. See below:

enter image description here

For example, I can clear the recycle bin from the VSCode terminal without using sudo when I put the code in the ~.bash_profile

alias t='rm -rf ~/.Trash'

Clear the recyle bin:

$ t

This will work as VSCode will have full disk access now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .