emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] conda doesn't work in ob-shell sessions


From: Jack Kamm
Subject: Re: [BUG] conda doesn't work in ob-shell sessions
Date: Sun, 21 Jan 2024 14:48:38 -0800

Ihor Radchenko <yantar92@posteo.net> writes:

> So, I believe that the following should work for you
>
> #+begin_src shell :session *myshell* :results output
> conda activate ledger
> #+end_src

No, it is still broken after switching to "shell" block, though the
error is different now. (Though I agree the previous error message was
due to using "sh" block and not ob-shell's fault).

Here is my minimal example. In init.el:

(add-to-list 'load-path "/path/to/org-mode/lisp")
(require 'org)
(org-babel-do-load-languages
   'org-babel-load-languages
   '((emacs-lisp . t)
     (shell . t)))

Then do:
emacs -q --load init.el test.org

With test.org like:

#+begin_src shell :session *shell* :results output
  conda activate some-conda-env
  echo test
#+end_src

Then, on main branch, trying to execute the block hangs. It is because
conda changes the prompt in a way that breaks the new ob-shell
implementation.

On bugfix branch, ob-shell still works with conda. I do observe a
separate bug on the first evaluation ("org-babel-execute:shell: Symbol’s
value as variable is void: org-babel-prompt-command"), but subsequent
evaluations work, and the error seems unrelated to conda.

IMO breaking conda is a pretty major regression, as conda is a critical
tool in many areas of scientific computing, including in my own
workflows.  Although I was never a major ob-shell user, I did
occasionally find it useful albeit buggy. But I've stopped using it
altogether over the past year because of this change.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]