Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate from home directory to file double clicked directory automaticly #11426

Open
Wickdhub opened this issue Nov 10, 2021 · 3 comments
Open

Comments

@Wickdhub
Copy link

Problem

Following the opening document of jupyterlab app on desktop: add launch documentation · jupyterlab/jupyterlab-desktop@71be7c6, I create a batch file that allows me to open a .ipynb file directly with the app on double click and to set the home folder to my desire one:

set JLABPATH=C:\JupyterLab
set HOMEDIR=C:\Users\Username\
start "" %JLABPATH%\JupyterLab.exe %HOMEDIR% %1

However, the directory stays in the Home and does’nt change when I open the file, contrary on web browser when I set the
jupyter_server_config.py with c.ServerApp.root_dir = "C:/Users/Username/Desktop/" and use a batch file like:
set ANACONDAPATH=C:\Users\Thomas\anaconda3
start "" %ANACONDAPATH%\pythonw.exe %ANACONDAPATH%\cwp.py %ANACONDAPATH%^ %ANACONDAPATH%\pythonw.exe %ANACONDAPATH%\Scripts\jupyter-lab-script.py %1

Capture
Let’s say I want to open a file on …/Desktop/dir1/dir2/test.ipynb with browser (page on the top of the image):

Whereas on app I just got the page on the bottom with written dir1/dir2/test on the top of the app.

Did someone know how I can change that?

Thanks a lot

Proposed Solution

Additional context

@welcome
Copy link

welcome bot commented Nov 10, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@krassowski
Copy link
Member

I think the behaviour should be changed to ensure that the file browser navigates to opened file regardless of whether it is opened from command line or URL. In the meantime you can enable "Show Active File in Browser":

Screenshot from 2021-11-10 09-51-19.

Please refrain from posting the same question in multiple places simultaneously (StackOverflow, Discourse, GitHub) - I know it is tempting but it drains maintainer energy and ultimately you get less likely to get a reply past some threshold when multiple users do that. At the very least please include a link to other places where you asked the question when posing.

@Wickdhub
Copy link
Author

Wickdhub commented Nov 10, 2021

Hello, thank you very much for your answer, I'm sorry for multiposting but you are the first person to answer me since 3 days, I had started to lose hope and I didn't know what to do to get help. I hope you will excuse me.

However, although the option name does indeed seem to do what I want, when opening my .ipynb file with a different home than the file directory, it doesn't seem to work and gives me the same result as before. (I stay on the directory when I closed the app).
It only works when I have 2 files open and that I switch between them.

@jasongrout jasongrout changed the title Navigate from home directory fo file double clicked directory automaticly Navigate from home directory to file double clicked directory automaticly Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants