-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Working folder is wrong - not current directory #534
Comments
Some more details... In
and many more I note that the |
Looking into this a bit more... When I launch a kernel, it appears in the current directory. When I launch a new session on an existing kernel, it is in the old (original) directory. Is this the expected behavior? Is there some way to have sessions start in the current working directory of the Org file? |
Kernels will be launched in the same directory as a notebook when it first launches so if you have a session |
No If I don't specify a session, and just use
I get an error: So I have this setting: (setq org-babel-default-header-args:jupyter-python '((:session . "ds")
(:kernel . "ds")
)) Now when I run the above Babel block (exactly as written, no
If I open a new file in my home folder and run it,
Note - new session, run from But you are correct, each session does launch its own kernel. If I run
|
Note - I've been using |
Oh I see. I was assuming that just having non- Can you evaluate the following code before launching your sessions. It should give the behavior you want. I'll have to think about if this is the right solution in general because it would mean having to do this for each language supported by Emacs-Jupyter. (cl-defmethod jupyter-repl-after-init (&context (jupyter-lang python))
(jupyter-eval (format "import os;os.chdir(\"%s\")" default-directory))) |
I have Your proposed fix does work. Thank you. |
When I start a new kernel it's often in a working folder or directory from a previous run. For example, given,
I would expect the following new session to be in the same location, but it is rarely there.
How can I make new Jupyter sessions default to $(pwd)?
The text was updated successfully, but these errors were encountered: