-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
running vscode with gksudo or sudo permission #3068
Comments
Repros on Ubuntu. Setup: touch test
sudo chown root test
sudo ~/tools/VSCode-linux-x64/Code . Output: ~/temp
❯ sudo ~/tools/VSCode-linux-x64/Code .
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
[VS Code]: detected unresponsive Process stats:
|
Related issue: #1614 |
|
The EACCES errors can be fixed by tweaking permissions since .config is normally only Once that's passed, vscode load and, gives a warning about how you shouldn't run as root. Only files owned by root can be modified in this instance of vscode. |
This works with Chrome:
|
The whole thing is pretty messy after understanding it, it would be better to request sudo acces when a file is saved. Something like this might work? https://www.npmjs.com/package/electron-sudo |
I've managed to get it working fairly nicely being run with sudo using a custom user data dir, however it hangs unless run as the normal user at least once. This is how it I can get around it currently: # First launch, code will create the data dir then hang with no errors in console
sudo ../VSCode-linux-x64/code-oss --user-data-dir=/home/daniel/data-dir .
# Give daniel access to ~/data-dir
sudo chmod -R 777 /home/daniel/data-dir/
# Launches fine as regular user now
../VSCode-linux-x64/code-oss --user-data-dir=/home/daniel/data-dir .
# Remove daniel access
sudo chmod -R 700 /home/daniel/data-dir/
# Launches fine as root user now
sudo ../VSCode-linux-x64/code-oss --user-data-dir=/home/daniel/data-dir . |
All files seem to be created correctly.
The welcome page never comes up though, and the menu bar hangs when I try to open the license. |
The issue is with
|
http://linux.die.net/man/1/xdg-open
|
This commit adds the --user-data-dir argument which allows a custom data dir for Chromium's user data. This is useful when running as root on Linux since the root user does not have read or write permissions for the ~/.config/Code dir. Part of #3068
this is the solution to me. access terminal with root and ...
flw.vlw |
visual studio not starting up when running it with gksudo or sudo permission on my Arch Linux. The window just got hanged every time. Starting normally works.
Can not save a file whose owner is root, Gives EACCESS_PERMISSION error. In case of other editors, saving the same file invoking gksudo automatically.
The text was updated successfully, but these errors were encountered: