I am trying to use Visual Studio Code with Remote-SSH extention (so I am working on a Windows machine while project files are on remote Linux server).
In order to build the project (C++ & CMake) I need to execute a script which sets up some environment variables.
Is there a way to execute such script automatically when vscode starts up its server?
It seems to be useless for me to call this script using vscode's terminal because then these variables are availiable only in this terminal session and not for the tools & extensions which vscode uses.
In VS Code, select Remote-SSH: Connect to Host... from the Command Palette (F1, Ctrl+Shift+P) and use the same user@hostname as in step 1. If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually.
VS Code Remote SSHSSH, or the secure shell protocol, lets you access a remote computer or virtual machine securely over a network connection. You can connect over SSH into another machine from Visual Studio Code and interact with files and folders anywhere on that remote filesystem.
Developer Community. - select Environment in the left column, then click the "down arrow" and select <Edit...> - the Environment dialog should appear. (the second variable is concatenated to the value of the first one).
Select and activate an environment# To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).
I've put something like this in my ~/.bashrc
, I guess other login scripts may be used instead based on you shell, hope it helps:
if [[ $TERM_PROGRAM = 'vscode' ]]; then
export DISPLAY=:100
fi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With