|
|
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.
\% U* h3 {. F3 Z7 l) A
' w- D: }+ ?- j1 U
+ t3 Q- ]+ j# v( e* p( A5 K0 Q' Y' Z. R- O
解决办法:% k7 M8 o9 e3 h/ J
. U4 e! Y9 c8 P设置永久别名 (Alias)
! H% A1 L4 e* B R为了方便使用,可以在 ~/.bashrc 或 ~/.zshrc 中添加别名:0 H9 e/ c, i$ ^( j
执行 vim ~/.bashrc。
' s2 o) ~0 I# o3 a& }在末尾添加:
, n9 x1 m. W% J( ]! `) H; a# [( M$ X
alias code='/usr/bin/code --user-data-dir=~/.vscode-root --no-sandbox'2 s" l4 v( X7 ^% f4 P
" N% `+ C7 X0 e3 }7 \2 N3 k; m1 i2 P1 S& h8 k2 o6 U
保存并退出,运行 source ~/.bashrc 生效。之后只需输入 sucode 即可启动。
; O7 t- [8 c' S2 C; KStack Overflow
4 l, N0 C( D, a) z# d; o1 f' |9 BStack Overflow
& o4 j4 _- w( Z2 k
, S' J" S* `* T: b% t
! U1 t( ?7 y' k) I5 [: r. w再次执行即可使用了。& d+ O9 |- t; @ p; ~) F! M
! A$ T1 I9 v; { |
|