Skip to content

Conversation

@fcollonval
Copy link
Member

References

Fixes #14443

Code changes

Set sessionContext has localPath (dropping the drive name)
Pass cwd without the drive name when starting terminals

User-facing changes

For browser with non-default drive (like for RTC), the kernels should start in the file folder and the terminals and consoles should open in the current directory.

Backwards-incompatible changes

None

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@krassowski
Copy link
Member

krassowski commented May 15, 2023

The console test failures appear relevant.

execute: async args => {
const name = args['name'] as string;
const cwd = args['cwd'] as string;
const localPath = serviceManager.contents.localPath(cwd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UI tests are also relevant.

The problem is that cwd can be undefined. For example, when creating a new terminal from the File -> New -> Terminal menu, the cwd is undefined.

@jtpio jtpio modified the milestones: 4.0.0, 4.0.x May 15, 2023
@hbcarlos
Copy link
Member

The remaining test failures are not related.

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jtpio jtpio merged commit 0d7a24c into jupyterlab:main May 22, 2023
@jtpio
Copy link
Member

jtpio commented May 22, 2023

Thanks!

@fcollonval fcollonval deleted the fix/14443-wrong-kernel-cwd branch May 23, 2023 05:54
@jtpio
Copy link
Member

jtpio commented Oct 22, 2023

For browser with non-default drive (like for RTC), the kernels should start in the file folder and the terminals and consoles should open in the current directory.

What does "file folder" means here? What should then be the expected behavior in the case when multiple drives with possibilly the same file names (example.ipynb in both the default filebrowser and another drive) are used simultaneously?

With 3.6.x it was possible to get some information about this since the drive name was kept as the session context prefix, and visible in the tooltip:

image

But with JupyterLab 4 it's not the case anymore:

image

Which makes it difficult to know about which kernels are being used, especially when there are files with the same name in two different drives:

image

@jtpio
Copy link
Member

jtpio commented Oct 22, 2023

Raising this question because it looks like this change (released in JupyterLab 4.0) affected JupyterLite downstream: jupyterlab-contrib/jupyterlab-filesystem-access#55 (comment)

The drive name used to be passed along as a prefix (for example FileSystemAccess:) which means the server was aware of the drive currently in use, which could then be passed to the kernel on startup. This allowed for accessing files from other drives from within a JupyterLite kernel in a seamless way.

Looking more into it, JupyterLab does not even seem to allow this anymore, since the information about the drive being used in never sent to the server, now that the session context path defaults to the local path (without the drive name).

Potentially something to look into as part of #15143, to allow for such uses case like in JupyterLite.

@jtpio
Copy link
Member

jtpio commented Oct 22, 2023

Looks like #13866 might also be related.

@echarles
Copy link
Member

echarles commented Oct 22, 2023

What does "file folder" means here? What should then be the expected behavior in the case when multiple drives with possibilly the same file names (example.ipynb in both the default filebrowser and another drive) are used simultaneously?

I have similar questions as @jtpio.

Overall, my question is what is the strategy/logic of the drives (registration, usage, naming convention, URI...) across JupyterLab and its extensions.

This is a broader question than the issue fixed by this PR, and this may be already defined somewhere (?), just asking...

@jtpio
Copy link
Member

jtpio commented Oct 23, 2023

This is a broader question than the issue fixed by this PR, and this may be already defined somewhere (?), just asking...

Yes very likely a broader question that would involve more design work on the drive feature. I opened #15289 to discuss this more in an issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong kernel working directory in collaborative mode

5 participants