|
|
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.
* L/ H) E/ |2 [3 j% h
& c: ^/ X0 g4 i$ }- |0 ]/ [& j
* {6 L3 \: R! @) `% F0 Z. K$ U5 u
解决办法:
: \- H& d4 q. \: C" I% N2 |& N, `3 B2 [; v7 E& n9 l A7 Y8 N6 l9 W
设置永久别名 (Alias) ' A, I# p/ v$ x6 z
为了方便使用,可以在 ~/.bashrc 或 ~/.zshrc 中添加别名:
. x3 W" ~, F9 n6 N3 g7 j- |+ _执行 vim ~/.bashrc。- D# r, S H9 J4 l- F
在末尾添加:+ m" o& D- v. } D3 {' `7 \
# g' t0 V+ z+ X
alias code='/usr/bin/code --user-data-dir=~/.vscode-root --no-sandbox'# d* {* I8 f _
* Y( z6 l# Q8 F, Z- R6 G! |% w- w$ c% D5 e6 V, w8 K& c
保存并退出,运行 source ~/.bashrc 生效。之后只需输入 sucode 即可启动。 % l" ^; F% J) |
Stack Overflow! x% I, {4 R0 q. L. |2 @: K: ]4 {
Stack Overflow8 R8 K6 h9 W, N4 ~& L0 X4 [
* ~1 u1 l: r$ d- y, w$ k, L5 ]8 |9 R# D$ P8 _' y/ H! L
再次执行即可使用了。& X/ G8 w$ n1 g/ M, W+ i
0 _3 y; h O+ ^9 Q
|
|