When I attempt to work with shell source blocks in session mode (:session argument) I'm receiving in RESULTS block an unwanted sign (probably line continuation sign) in multi line commands like 'for' loop.
----------------------------------------------------------------------- ---- How it works at the moment --- ----------------------------------------------------------------------- #+BEGIN_SRC sh :session test for i in `seq 1 5`;do echo $i echo done #+END_SRC #+RESULTS: | > | > | > | 1 | | | | | | | 2 | | | | | | | | | | 3 | | | | | | | | | | 4 | | | | | | | | | | 5 | | | | ----------------------------------------------------------------------- --- code evaluation taken from 'test' buffer --- ----------------------------------------------------------------------- for i in `seq 1 5`;do $ echo $i > > echo > done 1 2 3 4 5 $ echo 'org_babel_sh_eoe' org_babel_sh_eoe $ ----------------------------------------------------------------------- --- Expected behavior (for this case adding a sign is omitted by running the loop in one line mode --- ----------------------------------------------------------------------- #+BEGIN_SRC bash :session test7 for i in $(seq 1 5);do echo "hello"; done #+END_SRC #+RESULTS: | hello | | hello | | hello | | hello | | hello | Some further troubleshooting revealed that by exporting PS2 to an empty string this behavior can be temporarily suppressed. Regards, Peter Emacs : GNU Emacs 25.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.26) of 2017-12-16 Package: Org mode version 9.1.6 (9.1.6-16-g86a382-elpaplus @ /home/cqs/.emacs.d/elpa/org-plus-contrib-20180115/)