fix(org): omit -i switch from org-babel-python-command

The -i switch for python or ipython can cause python org src blocks to
hang indefinitely when executed.

Ref: hlissner/doom-emacs@c0d988fe0d
Ref: #5569
This commit is contained in:
Henrik Lissner 2021-11-28 21:59:52 +01:00
parent f0ba6c99b2
commit c93790bb5c

View file

@ -310,7 +310,12 @@ Also adds support for a `:sync' parameter to override `:async'."
(after! python
(unless org-babel-python-command
(setq org-babel-python-command
(concat python-shell-interpreter " " python-shell-interpreter-args))))
(string-trim
(concat python-shell-interpreter " "
(if (string-match-p "\\<i?python[23]?$" python-shell-interpreter)
(replace-regexp-in-string
"\\(^\\| \\)-i\\( \\|$\\)" " " python-shell-interpreter-args)
python-shell-interpreter-args))))))
(after! ob-ditaa
;; TODO Should be fixed upstream