Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode always ask for permission to save

I'm new to Ubuntu and here is my issue:
VSCode is always asking for permission to save any edit on any file.

I just want to edit and save without having to enter my password every time so is this possible on Ubuntu?
I tried to add a new user, but I see also the same problem.
I tried to run VSCode as root, but it said it's dangerous to run it as root.

How can I avoid this permission step when saving a file with VSCode?

like image 478
Omar Abdelhady Avatar asked Jun 23 '18 18:06

Omar Abdelhady


People also ask

How do I enable auto save feature in VS code?

The easiest way to turn on Auto Save is with the File > Auto Save toggle that turns on and off save after a delay. For more control over Auto Save , open User or Workspace settings and find the associated settings: files.

How do you give permission to VS code?

The chmod command help to add permission. You run the chmod command inside your Pendrive or project folder/directory. The chmod command Basically changes your file permission. So that vscode autosave saves your file without sudo privilege.

How do I give permission to Vscode in Ubuntu?

Make sure that you (as an Ubuntu user account) are the owner of the folder and files you are editing in VSCode: cd /path/to/my/files chown -R $USER:$USER . Note: If you are not the user, you might have to precede that with sudo : sudo chown -R $USER:$USER .


1 Answers

Make sure that you (as an Ubuntu user account) are the owner of the folder and files you are editing in VSCode:

cd /path/to/my/files chown -R $USER:$USER . 

Note: If you are not the user, you might have to precede that with sudo:

sudo chown -R $USER:$USER . 

(Note: full stop makes you the owner of the files in the parent directory)

like image 78
VonC Avatar answered Oct 15 '22 03:10

VonC