> On Jun 4, 2018, at 9:42 AM, Marian Schubert <marian.schub...@gmail.com> wrote: > > I'm having trouble with babel block like this: > > > #+BEGIN_SRC shell :results output :session abc > echo foo#bar > #+END_SRC > > When I execute it for the first time I get this result: > > #+RESULTS: > : > : foo#bar > > When I execute it again I get this: > > #+RESULTS: > : > : bar > > (foo# is missing) > > Any idea what might be wrong? I'm using version 9.1.13. >
After running that I get this in the abc buffer for M-x describe-variable RET comint-prompt-regexp RET ,---- | comint-prompt-regexp is a variable defined in ‘comint.el’. | Its value is "^[^#$%> | ]*[#$%>] *" | Local in buffer abc; global value is "^" | | Documentation: | Regexp to recognize prompts in the inferior process. | Defaults to "^", the null string at BOL. | | This variable is only used if the variable | ‘comint-use-prompt-regexp’ is non-nil. | | Good choices: | Canonical Lisp: "^[^> \n]*>+:? *" (Lucid, franz, kcl, T, cscheme, oaklisp) | Lucid Common Lisp: "^\\(>\\|\\(->\\)+\\) *" | franz: "^\\(->\\|<[0-9]*>:\\) *" | kcl: "^>+ *" | shell: "^[^#$%>\n]*[#$%>] *" | T: "^>+ *" | | This is a good thing to set in mode hooks. | | [back] `---- The first hash is not recognized as a prompt, but the rest are. If you really need to use the hash, then running : (set-local comint-prompt-regexp "^[^$%>\n]*[$%>] *") in the `abc' buffer might help. This has obvious problems if you run as root and do not reset the prompt to something other than #. HTH, Chuck