I use VSC on two different remote servers, which I connect to via the extension remote-ssh + Python + Jupyter (the usual).
After connecting via ssh, I open a folder with the same relative path (wrt home): ~/workspace/project
. The folder contains the same branch of a GitHub repository, which has a Python notebook nb.ipynb
in the ~/workspace/project/src
folder.
I have this problem:
-
one one server, the working directory printed by
nb.ipynb
is~/workspace/project/src
, which that does not correspond to the folder I opened in VSC, which is always the project root. -
on the other server, the working directory (printed by the same notebook) is the project root:
~/workspace/project
, the one I have actually selected.
I looked for settings that modify the working dir and that I might have changed, but I could not find anyone related to this. The only one seems to be:
Jupyter: Notebook File Root
Set the root directory for Jupyter Notebooks and the Interactive Window running locally.
Note: This does not apply to Remote Jupyter Kernels.
${fileDirname}
In any case, this setting has the same value in the two installations.
How do I change the folder VSC uses as working folder for the notebooks?