This is the solution I’ve found to solve the following issue when I was trying to open a directory with VS Code inside “/srv/http”, which is the Apache root directory:
The error:
[1120/145333.465333:FATAL:electron_main_delegate.cc(292)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Trace/breakpoint trap (core dumped)
The solution: opening the current directory as sudoer user:
sudo code . --verbose --user-data-dir --no-sandbox