Background
I have a MySQL server running on a remote machine and am trying to debug a Django application running locally that connects to that remote database. Our team does this by forwarding the remote port 3306 to the local port 3308 using PuTTY. I found out recently that you can do this within VS Code as well using the Remote - SSH VS Code extension created by Microsoft.
After the SSH connection is configured, this is done by adding the port to the ports tab as shown below:
An alternative, described in the Remote - SSH docs, is to add the port to the ssh config file. This opens the port automatically every time an SSH connection is made:
The Problem
The trouble with both of these methods is it seems that the SSH connection cannot be made without the entire VS Code window turning into an "SSH Window" that is connected to the remote machine. Since I am working on a the Django application locally, this means I then need a second window open just to forward the port.
I would really like to be able forward a port in the same window that I am working on the local Django application. I would prefer doing it with the Remote - SSH extension, but am open to other methods. Bonus points if the tunnel is created automatically when I open the Django app repo in VS Code.
I tried searching for extensions that would do this and seeing if the Remote - SSH can connect without a dedicated window, but I couldn't find anything.