jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.73k stars 4.96k forks source link

Is there a way to open a terminal in the current directory? #1898

Open jfeist opened 7 years ago

jfeist commented 7 years ago

I often want to inspect some file in the current directory of the jupyter file browser in some more detail from the terminal, and intuitively click "New -> Terminal", expecting a new terminal to open in the current directory. However, the terminal starts in the root directory of the notebook server, not in the current directory. This is inconsistent with the behaviour of new text files, folders, and notebooks, all of which are created in the current directory. Is there any reason for the current behaviour? Since going back up in the directory tree in the terminal is much easier than digging down into a directory structure to get back to the folder that I wanted to work in, I don't think changing this would really affect any use case.

ellisonbg commented 7 years ago

Not possible yet, but this is something we would like to do. Tagging as JupyterLab milestone as we will likely end up implementing it there first.

ellisonbg commented 7 years ago

I think this will also require server changes as well...

farzadz commented 5 years ago

Any updates yet?

burado88 commented 4 years ago

This would definitely be a useful feature. Any updates?

Ratnakarmaurya commented 4 years ago

Any updates?

OliverEvans96 commented 4 years ago

It would be great to see this in Jupyterlab! This seems to be implemented already in the jupyterlab git addon via Git > Git Command in Terminal.

Edit: To clarify, jupyterlab_git will only take you to the root of a git repo that contains your current directory, it doesn't seem to work for other directories.

zincopper commented 3 years ago

Any updates?

RayFes commented 2 years ago

It would be really helpful to be able to right click in the file browser and select "Open terminal here". Please assign. Edit: Right clicking on a folder and selecting "Copy Path" can be used to paste after cd command in the terminal: comes a long way!

praksharma commented 2 years ago

Ok, I can confirm that this feature has been added. It works on my Jupyter lab 3.4.2.

I can see the current directory on the top of every launcher page. And the new terminal opens in that directory image

OliverEvans96 commented 2 years ago

I can also confirm that this is now implemented in jupyterlab (tested on v3.4.8), but still not in jupyter notebook as of v6.4.12.

jtpio commented 2 years ago

Adding to the 7.0 milestone as this also does not seem to be supported in Notebook 7 at the moment when creating a new terminal from file menu while in a subfolder:

image

OliverEvans96 commented 2 years ago

@hdsteineke and I would like to tackle this in the spirit of Hacktoberfest if that's alright with you @jtpio.

OliverEvans96 commented 2 years ago

BTW, this was addressed in jupyterlab in https://github.com/jupyterlab/jupyterlab/pull/12250

jtpio commented 2 years ago

@hdsteineke and I would like to tackle this in the spirit of Hacktoberfest if that's alright with you @jtpio.

That would be really appreciated, many thanks!

Don't hesitate to open a draft PR, happy to help.

jtpio commented 1 year ago

Taking another look at it, this will likely have to be fixed in JupyterLab first so creating a new terminal from the menu or command palette respects the current working directory: https://github.com/jupyterlab/jupyterlab/issues/13414