Ihor Radchenko writes: > miha@kamnitnik.top writes: > >>> Is it possible to distinguish the actual script output, empty lines in >>> the actual script output, and the incomplete prompts? >> >> You could prepend your multiline command with a dummy >> 'echo multiline_starts_here' command have your >> 'comint-output-filter-functions' discard output that arrives before >> "multiline_starts_here". > > For context, I am asking because I am trying to figure out how ob-shell > works in Org mode. My multiline command can be arbitrary bash script > containing multiple single- and multi-line commands. It is hard to > figure out which one is which. I see. Perhaps you could turn your bash script into a single multi-line command by encapsulating it into an 'if true' block. So given if [ $(( 1 + 1 )) = 2 ] then echo "hello" fi echo $(( 3 + 4 )) you could encapsulate it into something like if true; then echo "multiline_starts_here" if [ $(( 1 + 1 )) = 2 ] then echo "hello" fi echo $(( 3 + 4 )) echo "multiline_ends_here" fi