"code"命令在禁用信任后请求root



使用Ubuntu 20.04

直到最近,我还能够使用code命令通过终端打开vscode中的文件。但是,在"设置"(UI(中取消选中Security > Workspace > Trust: Enabled后,此功能被破坏。

无论工作区的信任状态如何,我都会遇到以下情况:

-$ code
need to run as root or suid
-$ sudo code
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

虽然重新启动VSCode并没有解决问题,但在计算机完全重新启动后,它就消失了。

### Try kill any VSCode instance:
for pid in $(ps aux|grep "/code"|grep -v grep|awk '{print $2}')
do
kill -9 $pid
done
### Now, reopen the VSCode and try again

最新更新