How to open another window of VSCode for Same SSH Connection? - visual-studio-code

I want to have two different VSCode windows that are both SSH'd to the same server.
Lets say that I have one window of VSCode (window-A) that is SSH'd into server-1. I now want to open another window of VSCode (window-B) and SSH into the same server (server-1).
However, when I try and do this currently, VSCode will not let me connect to the same server(server-1) in the new window (window-B). When I try to SSH to server-1 in window-B, the original window of VSCode (window-A) keeps popping up.
Is there a way to get around this?

Related

Vscode Ssh Remote

I'm using vscode with the remote ssh plugin, I can connect normally, but I need that right after synchronizing with the server, a linux command is executed when opening a connection, that is, this command has to be executed, in fact it is a sudo, I need that it is already synced as root, thanks

Enter commands in VSCode's Remote-SSH environment

I am using the VSCode extension Remote-SSH to connect to a remote server.
However, on this server, I can only login via the login node. I'm not allowed to run heavy tasks on this node, so I need to enter voltash to get transferred to a usable node.
I can do this by opening a new terminal. However, the current node remains unchanged on Remote-SSH:
Even though the terminal window says I am on n-62-27-20 (the name of the node I'm currently on, in the terminal), the Remote-SSH status bar (bottom left) still is on the login node.
My question is: is there a way to enter this voltash command inside the Remote-SSH extension?
I found this: https://stackoverflow.com/questions/57780250/does-vscode-remote-support-double-ssh however, I can't enter a server IP as I need to use a command (voltash).

SSH Targets , How to "Connect to Host in New Tab"

I am learning how to use SSH Targets in VS code on my Mac to check/edit the files in remote server.
The annoying part is I am unable to connect to the remote host in a new tab. It gives me only below options:
Connect to Host in New Window
Connect to Host in Current Window
When i choose the Current Windows all my open local files are forced to quit.
Anybody can suggest how to workaround this problem in vs code itself?

How can I SSH login from RStudio terminal

I want to make a SSH login to a high performance computer from the terminal in RStudio so I can execute my code by highlighting it in RStudio script and pressing Alt+Ctrl+Enter directly. However, the RStudio terminal has a problem with SSH because of a key issue. Did anyone successfully SSH login from the RStudio terminal and could tell me how to do it?
I found the answer here . After setting Command Prompt as the terminal, and opening the terminal, we have to type
set DISPLAY=
and then run the ssh login. It will then ask for the key. set DISPLAY = needs to be typed every single time you want to connect the R terminal to ssh.
I hope this question and answer helps anyone else, if not, feel free to suggest deleting it.

Starting vscode directly in remote ssh

I'm using vscode remote ssh heavily and each time, I have to start it regularly and and run the commmand to start a new instance with Remote SSH
Is there a way to use some arguments to VsCode shortcut to start directly in Remote SSH mode?
Thanks
Found this link that includes a section about connecting to a remote from terminal (or using a shortcut)
https://code.visualstudio.com/docs/remote/troubleshooting#_connect-to-a-remote-host-from-the-terminal
SSH remote needs to already have been manually setup (ssh config file and public/private key).