Where is “Run Selection/Line in Interactive Window” in VS Code when connected to a Remote Server via SSH?

Posted on

Problem :

I am coding a project on my local machine with VS Code. Everything works fine. I deploy the code to a remote ubuntu server in the google cloud and connect to the code base there via VS Code SSH.
(https://code.visualstudio.com/docs/remote/ssh) The connection works and I see and edit the code base fine with git.

Problem is that I’ve lost the keyboard shortcuts to “Run Selection/Line in Interactive Window” and “Run Selection Line in Python Terminal” when I am connected to the remote server. In fact, my right click options are much reduced. See screens below to get an idea.

On my local machine all of the options are there. I have researched the VS Code documentation and cannot find mention of remote restrictions related to the right click options. When I go to preferences, most all of the keyboard shortcuts from the local workstation are missing.

I can run the code on the remote server using a bash shell in VS Code. But ideally, I would like to run the code, or bits of it in an interactive window using the jupyter kernel like I do locally.

How do I enable the usual right click “Run” options when I connect to the remote server? I feel like I’m missing something in the configs but cannot find how to remove the remote restrictions. (Perhaps it is just not allowed?)

Right Click Options on Local Workstation

Right Click Options on Remote Server

Solution :

OK – I’ve discovered the answer. I did not realize that my local extensions are not installed by default into the workspace for the remote server. (I thought it did this automatically)

With the Python and Jupyter extensions installed into the remote workspace, my menu options have now re-appeared.

I hope this helps someone else!

Leave a Reply

Your email address will not be published. Required fields are marked *