On Mon, Feb 26, 2018, at 6:27 AM, Nicolas Goaziou wrote: > Tyler Smith <ty...@plantarum.ca> writes: > > > > How do I force the babel session to leave the output alone, and print > > it verbatim into the org file? > > It may be related to other problems related to prompt in shell sessions. > See for example > <http://lists.gnu.org/r/emacs-orgmode/2018-02/msg00081.html>, > <http://lists.gnu.org/r/emacs-orgmode/2018-01/msg00415.html>, and for > step forward a solution > <http://lists.gnu.org/archive/html/emacs-orgmode/2017-04/msg00147.html>. > > Patches welcome!
It looks like ob-shell sets up sessions just by calling `shell`, which means all the user's customizations for shell-mode are automatically applied. This includes setting the prompt (e.g., from .emacs.d/init_bash.sh), as well as the value of `comint-prompt-regexp`. I can't see any straightforward way to modify ob-shell sessions without also changing regular shell-mode. So I wonder if the easiest way to address this would be to create a new mode derived from shell-mode, ('ob-shell-mode')? That would give us a way to modify the prompt code inside babel without interfering with shell-mode. If that sounds sensible I can put together a patch for ob-shell.el. Let me know what you think. Best, Tyler