I recently switched to using Visual Studio Code from Sublime Text and have a question about the terminal functionality. It looks like "Integrated Terminal" that appears at the bottom is mounted to the local file system out of the box.
What I'm wondering is if I can replace this local terminal with a remote server? I have the hostname, port, and login credentials and would love to be able to navigation the file system on our remote server (like using MobaXterm, PuTTy, etc) and then open code files in Visual Studio Code instead of vim or emacs. Is this possible?
Thanks!!
Connect to a remote host Verify you can connect to the SSH host by running the following command from a terminal / PowerShell window replacing user@hostname as appropriate. 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.
You can connect over SSH into another machine from Visual Studio Code and interact with files and folders anywhere on that remote filesystem. If you have an app located on a different computer, you could use SSH to connect to it and access your app, view its files, and even modify, run, and debug it.
Click on the indicator to bring up a list of Remote extension commands. Choose the Remote-SSH: Connect to Host command and connect to the host by entering connection information for your VM in the following format: user@hostname . The user is the username you set when adding the SSH public key to your VM.
UPDATE: I have figured out how to rig this into VS code.
You can download git bash online and it will be mounted to your local machine. In VS Code, you can then Ctrl+Shift+P and type "Open User Settings". In the right pane, add this setting:
This will replace the default integrated terminal in VSCode with the git bash CLI client that was just installed in the location in the screenshot above. Now that you have your local file system mounted in VScode, you can execute:
ssh username@hostname -p <port>
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