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

filesystem completions always relative to root directory of jupyter #140

Open
kb1ooo opened this issue Apr 7, 2020 · 5 comments
Open

filesystem completions always relative to root directory of jupyter #140

kb1ooo opened this issue Apr 7, 2020 · 5 comments

Comments

@kb1ooo
Copy link

kb1ooo commented Apr 7, 2020

A fairly significant annoyance is that file system completions are all relative to the directory the kernel starts up in as opposed to the working directory. So, while cd works properly to change the working directory for any code that is run through the matlab engine, the auto-complete always thinks your working directory is the directory the kernel started up in. At least that's what happens for me on 2019b. I looked into this a little bit and came up empty for a fix.

@blink1073
Copy link
Contributor

This is something Jupyter does explicitly for all kernels.

@kb1ooo
Copy link
Author

kb1ooo commented Apr 11, 2020

I'm not sure we're on the same page with this so just wanted to give a concrete example because I don't think the behavior is the same for the python kernel. E.g. suppose my home directory is /home/kb1ooo and is where I run the jupyter server from. And suppose I have the following sub directories

/home/kb1ooo/tmp
/home/kb1ooo/tmp/baby

When I start up a matlab kernel and type cd tmp in a cell and run it, then type pwd in another cell and run it, I get

ans =
    '/home/kb1ooo/tmp'

as expected. If I then type cd ba and then hit tab to get completions, it doesn't give me 'baby' as a possible completion (unless I also happen to have a '/home/kb1ooo/baby' directory). So, from the perspective of the file system tab completion, my working directory is always /home/kb1ooo, in spite of the fact that pwd returns the proper working directory. This does not happen in a python kernel where if I run the exact same cells, I get 'baby' as a tab completion as expected.

@blink1073
Copy link
Contributor

Ahh, the logic for path completion is here. I'm not sure why . isn't resolving to the cwd of the kernel.

@kb1ooo
Copy link
Author

kb1ooo commented Apr 12, 2020

Ok, I hadn't realized that the filesystem completion didn't come from the kernel's get_completions. Can you confirm that this same behavior happens for you with this kernel? I assume it doesn't happen for other kernels built using metakernel?

@blink1073
Copy link
Contributor

I don't actually have a copy of Matlab. I just confirmed that the Octave kernel is working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants