notebook icon indicating copy to clipboard operation
notebook copied to clipboard

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

Open jfeist opened this issue 8 years ago • 9 comments

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.

jfeist avatar Nov 15 '16 10:11 jfeist

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 avatar Dec 23 '16 01:12 ellisonbg

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

ellisonbg avatar Dec 23 '16 01:12 ellisonbg

Any updates yet?

farzadz avatar Feb 01 '19 07:02 farzadz

This would definitely be a useful feature. Any updates?

burado88 avatar Dec 17 '19 13:12 burado88

Any updates?

Ratnakarmaurya avatar Dec 24 '19 15:12 Ratnakarmaurya

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.

OliverEvans96 avatar Feb 14 '20 00:02 OliverEvans96

Any updates?

zincopper avatar Jan 23 '21 19:01 zincopper

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!

RayFes avatar Jan 04 '22 09:01 RayFes

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

praksharma avatar May 19 '22 13:05 praksharma

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.

OliverEvans96 avatar Oct 19 '22 19:10 OliverEvans96

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

jtpio avatar Oct 20 '22 09:10 jtpio

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

OliverEvans96 avatar Oct 20 '22 19:10 OliverEvans96

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

OliverEvans96 avatar Oct 20 '22 23:10 OliverEvans96

@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 avatar Oct 21 '22 08:10 jtpio

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

jtpio avatar Jun 09 '23 07:06 jtpio